Bug 6508 - Inconsistent exit code behavior between local, ssh transport, and rsyncd transport
Inconsistent exit code behavior between local, ssh transport, and rsyncd tran...
Status: RESOLVED FIXED
Product: rsync
Classification: Unclassified
Component: core
3.0.4
All All
: P3 major
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-25 18:23 UTC by Alexander Perlis
Modified: 2009-09-05 11:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Perlis 2009-06-25 18:23:34 UTC
Bug Summary
-----------
According to the man page, file vanish errors should get reported with exit code 24. This happens correctly when rsync is copying locally. Also happens correctly when rsync copies from a remote rsync invoked via ssh. But does *not* happen when rsync copies from a remote rsyncd. In that case, the remote rsyncd logs a code 24 in the remote syslog, but the local rsync exits with code 0.

I don't know whether this bug is specific to exit code 24, or also exists for other types of exit codes. The current report is similar to one given on the mailing list in 2002 (concerning exit code 23):

 http://lists.samba.org/archive/rsync/2002-October/003821.html

 http://lists.samba.org/archive/rsync/2002-October/003947.html


Affected Versions
-----------------
We discovered this bug in 2.6.9 and verified just now that it also exists in 3.0.4. (Unfortunately it is non-trivial at this moment for me to play around with 3.0.6 or 3.1.0. Sorry.) The reports from 2002 (see links above) concerned version 2.5.5.

Aside from the two links given above, I have found no other discussions (in bugzilla or on the web) concerning inconsistent exit code behavior when comparing the ssh transport to a direct rsyncd connection.


How to reproduce:
-----------------

(0) mkdir rsync_experiment ; cd rsync_experiment

(1) Prepare rsyncd. I put the following in /etc/rsyncd.conf
  [myroot]
  path = /root/rsync_experiment/
  uid = 0
  read only = false

(2) Launch rsyncd. On Ubuntu edit /etc/default/rsync to have "RSYNC_ENABLE=true" and then do "invoke-rc.d rsync start"

(3) Create a loop script to create/delete files as rapidly as possible:
  #!/bin/sh
  mkdir -p src
  while true; do
    tempfile=`mktemp src/somefile.XXXXXXXX`
    rm -f $tempfile
  done

(4) Invoke about 10 copies of that script as background processes. I called my script "create_delete_loop.sh", and then just did:
  ./create_delete_loop.sh &
     [repeat previous command 10 times]

(5) Now compare the output of the following commands:

  rsync -av src/ dst/ ; echo $?
     [Correctly exits with code 24]

  rsync -av root@localhost:src/ dst/ ; echo $?
     [Correctly exits with code 24]

  rsync -av root@localhost::myroot/src/ dst/ ; echo $?
     [INCORRECTLY EXITS WITH CODE 0]

  rsync -av src/ root@localhost::myroot/dst/ ; echo $?
     [Correctly exits with code 24]

(6) Be sure to kill those rapidly looping file creation/deletion scripts from step (4), or soon your machine may freeze up on you!
  killall create_delete_loop.sh
  killall create_delete_loop.sh
    [keep repeating until it says no more processes to be killed]

Thanks.
Alexander Perlis
Comment 1 Wayne Davison 2009-09-05 11:47:17 UTC
This is now fixed in the git repo.