rename Couchbase to Store
[cloudstore.git] / rsync-piper.pl
index d5511d3..ed6d11b 100755 (executable)
@@ -12,7 +12,8 @@ use English;
 use Module::Refresh;
 
 use lib 'lib';
-use CloudStore::Couchbase;
+use WarnColor;
+use CloudStore::Store;
 
 my $dir   = $ENV{RSYNC_DIR}  || '/srv/cloudstore';
 my $port  = $ENV{RSYNC_PORT} || 6501;
@@ -55,7 +56,7 @@ if ( $ENV{SQL} ) {
        exit 1;
 }
 
-my $store = CloudStore::Couchbase->new;
+my $store = CloudStore::Store->new;
 
 mkdir "$dir/var" if ! -e "$dir/var";
 
@@ -140,6 +141,7 @@ sub rsync_running_pid {
 if ( my $pid = rsync_running_pid ) {
        if ( kill 0, $pid ) {
                warn "found rsync pid $pid\n";
+=for kill-rsync
                kill 2, $pid;
                while ( -e $pid_file ) {
                        warn "waiting for rsync to die...\n";
@@ -153,6 +155,7 @@ if ( my $pid = rsync_running_pid ) {
                }
 
                kill 0, $pid && die "can't kill it!";
+=cut
        } else {
                unlink $pid_file;
        }
@@ -194,12 +197,12 @@ $gearman->job_servers('127.0.0.1:4730');
 
 while(1) {
        die "no rsync running" unless kill 0, rsync_running_pid;
-       warn "# reading log output from $log_fifo\n";
+       warn "waiting for log from $log_fifo\n";
        open(my $fifo, '<', $log_fifo);
        while( my $line = <$fifo> ) {
                Module::Refresh->refresh;
                chomp $line;
-               print $line, $/;
+               warn $line, $/;
 
                if ( $line =~ /transfer-log:(.+)/ ) {
                        my $transfer = $1;