Failed starting rsync daemon from a remote server(ssh)

Matt McCutchen hashproduct+rsync at
Thu May 10 20:42:06 GMT 2007

On 5/10/07, wenjie zheng <wenjie.zheng at> wrote:
> Has anyone tried to start a rsync daemon from a remote server?
> I tried to execute the following command from a remote server A, but failed
> [root at A ~]# ssh crcdev1 "su virtual -c
> \"/usr/local/fenbu/replication/bin/rsync -v --daemon
> --bwlimit=1000
> --config=/usr/local/fenbu/replication/conf/email_rsyncd.conf\"
> "
> @RSYNCD: 29

The trouble is that the stdin that sshd provides to rsync is a socket,
and when rsync's stdin is a socket, rsync assumes it is supposed to
handle a single request over that socket instead of entering the
background and listening for any number of requests on the port given
in the configuration file.  To make rsync listen for requests,
redirect its stdin from /dev/null by adding </dev/null to the remote
command (it shouldn't matter whether the redirection is inside or
outside the su).

The special behavior when stdin is a socket was done so that "rsync
--daemon ..." would work as an xinetd command.  However (attn. Wayne),
it seems to me that there's no need for the behavior because the
administrator could get the same effect by passing --server .


More information about the rsync mailing list