--- /usr/local/bin/reposync Thu Nov 21 20:39:39 2019 +++ /tmp/reposync Thu Feb 13 14:38:12 2020 @@ -48,7 +48,7 @@ { if [[ -n $fwduser ]]; then # reach rsync on the server via an ssh port-forward - rsync -e "ssh -W localhost:rsync -l $fwduser" "$@" 2>&1 + rsync -e "ssh -S $sockfile -o ControlMaster=auto -o ControlPersist=1m -W localhost:rsync -l $fwduser" "$@" 2>&1 else rsync "$@" 2>&1 fi @@ -68,6 +68,7 @@ oldhash=invalid hashfile=$rundir/reposync.hash lockfile=$rundir/reposync.lock +sockfile=$rundir/reposync.sock cd $rundir || err "could not cd to $rundir" if [[ -h $lockfile ]]; then @@ -85,12 +86,13 @@ ln -s $$ $lockfile || err "could not lock $lockfile" -trap "rm -f $lockfile" 0 1 2 15 +trap "ssh -Fnone -S $sockfile -O exit -q -l $fwduser lolhost; rm -f $lockfile" 0 1 2 15 # check CVSROOT directory listing to identify updates; primarily for # ChangeLog but val-tags may also be updated after a checkout was done # using a new tag. ignore "history" (lists read-only operations). _t=$(run_rsync --exclude='history*' "${synchost}/CVSROOT/") +[[ $? -eq 0 ]] || exit $? [[ -n $fwduser ]] && case $_t in "stdio forwarding failed"*|"Stdio forwarding request failed"*) err "mirror does not support ssh port-forwarding" ;;