X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=rsync-piper.pl;h=04c3a8a6b44be031cb43885563a40898e8f99d80;hb=41187c9904153b484a817883805fb8ad6a206b40;hp=b82d3392626e4d589d148c6c3b991df431a881ac;hpb=0a185895cf955e776b54d509071fcea90d853b7e;p=cloudstore.git diff --git a/rsync-piper.pl b/rsync-piper.pl index b82d339..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,8 +98,14 @@ while(<$p>) { my ( $login, undef, $uid, $gid, $email, $path, $shell ) = split(/:/,$_,7); - if ( -d $path && -f "$path/.secrets" ) { - my @secrets = map { chomp; $_ } read_file "$path/.secrets"; + 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 ); $rsync_config .= <<__RSYNC_MODULE__; @@ -104,11 +113,11 @@ while(<$p>) { [$login] path = $path auth users = $auth_users - secrets file = $path/.secrets + secrets file = $path/.meta/secrets read only = false uid = $uid gid = $gid - filter = - /.secrets - /.md5 + filter = - /.meta # refuse options = c delete # dont compress = * incoming chmod = u=rwX,g+rX,o+rX @@ -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";