I am syncing some business data between two solaris servers. I am using post-xfer script to generate Email traps for non-zero exit status. However the exist status is always -1 See the output of set command mailed by sendmail to check RSYNC environment vars. RSYNC_EXIT_STATUS=-1 RSYNC_HOST_ADDR=172.29.146.49 RSYNC_HOST_NAME=minttest.id.citistreet.org RSYNC_MODULE_NAME=TMP RSYNC_MODULE_PATH=/tmp/TMP RSYNC_RAW_STATUS=-1 RSYNC_USER_NAME='' Is this a bug or I am not using proper config file. See the config section in rsyncd.conf log file = /tmp/RSYNC2.8.log [TMP] path = /tmp/TMP comment = /tmp/TMP read only = false uid = zhrumde gid = tivoli #pre-xfer exec = /tmp/send_mail.ksh post-xfer exec = /tmp/send_mail.ksh Thanks Hemant Rumde CitiGroup Boston MA
A -1 in RSYNC_RAW_STATUS means that the waitpid() call failed for some reason (the reason is not currently logged). In order for rsync to be able to run the post-xfer script with full permissions (i.e. outside any chroot, and as the original daemon user), it forks prior to the copy, and the parent process just waits around for the child to do the copy and exit. For some reason, the parent process is getting an error back from waitpid() instead of the exit status. I'd suggest running the daemon under a system-call logging tool (use rsync --daemon --no-detach to make things easier) and you will be able to see what happens with the waitpid() call.
Closing due to lack of response. Please feel free to add new information should this arise again.