start rsync on stale pid file
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 11 Feb 2012 14:27:26 +0000 (15:27 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 11 Feb 2012 14:27:26 +0000 (15:27 +0100)
rsync-piper.pl

index 00eb45b..0edf8b0 100755 (executable)
@@ -180,7 +180,7 @@ sub REAPER {
 $SIG{CHLD} = \&REAPER;
 
 
-if ( ! -e $pid_file ) {
+if ( ! -e $pid_file || ! kill( 0, rsync_running_pid ) ) {
        my $exec = "$rsync --daemon --config $cfg_file --no-detach --port=$port";
        warn "START $exec\n";