Hello, we would like to use rsync (2.6.2 manualy patched and recompiled) in daemon mode spawned by inetd (Solaris 5.8 Environment). /etc/services: rsync 1234/tcp #RSYNC daemon /etc/inet/inetd.conf: rsync stream tcp nowait publish /usr/bin/rsync rsyncd --daemon --port 1234 . Alas, this does not seem to work, there is the following error message in the log file: Fri Sep 10 10:41:54 MEST 2004 rsync: connection unexpectedly closed (0 bytes read so far) rsync error: error in rsync protocol data stream (code 12) at io.c(342) We are using a different daemon at the same time, which also is spawned by inetd, and works, so that should not be the option? Using rsync as standalone daemon works fine with the same settings, so my question is: is there an issue with rsync being called by inetd or are we missing something? I would be grateful for some help. Cheers, Claus Kick
On Fri 10 Sep 2004, Kick Claus wrote:> > we would like to use rsync (2.6.2 manualy patched and recompiled) in daemon > mode spawned by inetd (Solaris 5.8 Environment).Hmm, I don't know whether this is supported...> rsync stream tcp nowait publish /usr/bin/rsync rsyncd --daemon --port 1234 .AFAIK using --daemon tells rsync to become a daemon, and to listen to incoming connections (on port 1234 in this case) itself. This will fail as inetd is already listening to that port, hence it's in use. Inetd accepts the connection, and spawns the process with its stdin and stdout connected to the network socket.> is there an issue with rsync being called by inetd or are we missing > something?You'd have to let inetd start rsync with the same options as when rsync is started by ssh, something with --server I guess. This isn't documented though... What are your reasons for letting inetd accept the connection instead of having an rsync daemon? Paul Slootman
Date: Fri, 10 Sep 2004 13:35:30 +0200 From: Paul Slootman <paul@debian.org> Hello Paul,>> we would like to use rsync (2.6.2 manualy patched and recompiled) indaemon>> mode spawned by inetd (Solaris 5.8 Environment).>Hmm, I don't know whether this is supported...Hm, then lets simply wait for someone who can supply the necessary information then?>> rsync stream tcp nowait publish /usr/bin/rsync rsyncd --daemon --port1234 .>AFAIK using --daemon tells rsync to become a daemon, and to listen to >incoming connections (on port 1234 in this case) itself. This will fail >as inetd is already listening to that port, hence it's in use. >Inetd accepts the connection, and spawns the process with its stdin and >stdout connected to the network socket.So, I should try the same without specifying a port?>You'd have to let inetd start rsync with the same options as when rsync >is started by ssh, something with --server I guess. This isn't >documented though...Then I hope that someone reading this list can provide a definite answer :)>What are your reasons for letting inetd accept the connection instead of >having an rsync daemon?Well, first of all, that was the way described in my "Solaris 8 Administrators Guide" book. What is more, only changing two files and restarting inetd was necessary. Moreover, that way, it would be one process less which is running permanently, so I figured, doing it this way might save some system ressources. Finally, there is no need to write any additional shell scripts. Cheers, Claus Kick
On Fri, Sep 10, 2004 at 12:05:37PM +0200, Kick Claus wrote:> rsync stream tcp nowait publish /usr/bin/rsync rsyncd --daemon --port 1234 .As indicated in the rsyncd.conf man page, the command should be this: rsync stream tcp nowait publish /usr/bin/rsync rsyncd --daemon (I changed "root" to "publish" to match your command.) You don't specify a --port option because inetd is handling the connection. Rsync should notice that stdin is a socket and behave appropriately. ..wayne..
Hello Wayne, thank you for your help, you were correct. I guess the issue was basically me not understanding how inetd works. Again thank you, Claus> -----Original Message----- > From: Wayne Davison [mailto:wayned@samba.org] > Sent: Freitag, 10. September 2004 21:45 > To: Kick Claus > Cc: 'rsync@lists.samba.org' > Subject: Re: question about using rsync with inetd > > > On Fri, Sep 10, 2004 at 12:05:37PM +0200, Kick Claus wrote: > > rsync stream tcp nowait publish /usr/bin/rsync rsyncd > --daemon --port 1234 . > > As indicated in the rsyncd.conf man page, the command should be this: > > rsync stream tcp nowait publish /usr/bin/rsync > rsyncd --daemon > > (I changed "root" to "publish" to match your command.) > > You don't specify a --port option because inetd is handling the > connection. Rsync should notice that stdin is a socket and behave > appropriately. > > ..wayne.. >