DO NOT REPLY [Bug 6508] New: Inconsistent exit code behavior between local, ssh transport, and rsyncd transport

samba-bugs at samba-bugs at
Thu Jun 25 23:23:35 GMT 2009

           Summary: Inconsistent exit code behavior between local, ssh
                    transport, and rsyncd transport
           Product: rsync
           Version: 3.0.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P3
         Component: core
        AssignedTo: wayned at
        ReportedBy: alexanderperlis at
         QAContact: rsync-qa at

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):

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
  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:
  mkdir -p src
  while true; do
    tempfile=`mktemp src/somefile.XXXXXXXX`
    rm -f $tempfile

(4) Invoke about 10 copies of that script as background processes. I called my
script "", and then just did:
  ./ &
     [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 at localhost:src/ dst/ ; echo $?
     [Correctly exits with code 24]

  rsync -av root at localhost::myroot/src/ dst/ ; echo $?

  rsync -av src/ root at 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!
    [keep repeating until it says no more processes to be killed]

Alexander Perlis

Configure bugmail:
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

More information about the rsync mailing list