X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=rsync-piper.pl;h=04c3a8a6b44be031cb43885563a40898e8f99d80;hb=1af8a6c4eb9976794ce6ce0084d9ac3484022c06;hp=cdb23a22b76d553bc21c52c159ef69e8ebb6a203;hpb=ea35f528787f5efcc0cb9ec12375b79d36e31862;p=cloudstore.git diff --git a/rsync-piper.pl b/rsync-piper.pl index cdb23a2..04c3a8a 100755 --- a/rsync-piper.pl +++ b/rsync-piper.pl @@ -87,6 +87,9 @@ strict modes = no #pre-xfer exec = /srv/cloudstore/rsync-xfer-trigger.pl #post-xfer exec = /srv/cloudstore/rsync-xfer-trigger.pl +# inplace breaks update of deduped files +refuse options = inplace + }; open(my $p, '<', '/var/lib/extrausers/passwd'); @@ -95,6 +98,12 @@ while(<$p>) { my ( $login, undef, $uid, $gid, $email, $path, $shell ) = split(/:/,$_,7); + if ( -d $path && -f "$path/.secrets" && ! -e "$path/.meta/secrets" ) { + $store->api->mkbasepath( "$path/.meta/secrets" ); + rename "$path/.secrets", "$path/.meta/secrets"; + warn "UPGRADE $login rsync secrets location\n"; + } + if ( -d $path && -f "$path/.meta/secrets" ) { my @secrets = map { chomp; $_ } read_file "$path/.meta/secrets"; my $auth_users = join(', ', map { s/:.+$//; $_ } @secrets ); @@ -174,7 +183,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";