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@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 @ERROR: protocol startup error the error message in the rsync log files says: 2007/05/10 09:55:54 [30320] forward name lookup for crcdev1.excedent.usfailed: ai_family not supported 2007/05/10 09:55:54 [30320] connect from UNKNOWN (localhost) I have no problem start the rsync daemon locally (stay on crcdev1, run 'su virtual -c "/usr/local/fenbu/replication/bin/rsync -v --daemon --bwlimit=1000 --config=/usr/local/fenbu/replication/conf/email_rsyncd.conf" '). And the rsync I use is [root@crcdev1 ~]# /usr/local/fenbu/replication/bin/rsync --version rsync version 2.6.8 protocol version 29 Thanks in advance, Wenjie PS: The shell is clean. I tested it. -------------- next part -------------- HTML attachment scrubbed and removed
Matt McCutchen
2007-May-10 20:42 UTC
Failed starting rsync daemon from a remote server(ssh)
On 5/10/07, wenjie zheng <wenjie.zheng@gmail.com> 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@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: 29The 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 . Matt