hanging problem on cygwin

Hari Krishna Dara haridara at gmail.com
Wed Jul 27 23:51:34 GMT 2005

On 7/27/05, Wayne Davison <wayned at samba.org> wrote:
> On Wed, Jul 27, 2005 at 01:59:44PM -0700, Hari Krishna Dara wrote:
> > I was under the impression that "--daemon --rsh" functionality is
> > meant to simplify the above
> Firstly, that syntax is wrong: it's --rsh=ssh combined with a deamon
> source/destination (host::module), and yes it does simplify things, but
> no the connection does not happen via sockets (since it's entire purpose
> is to encrypt the connection over a secure transport such as ssh).
> Since the transfer is happening via the remote shell, it will be
> susceptible to the same pipe-related hangs as a normal non-daemon
> connection.
> ..wayne..

I am now more confused, could you please clarify something? There are
three separate sections in the rsync man page called:


I am now clear that the first approach is what is causing the rsync to
hang (because it is going through buggy cygwin pipes), and I agree
that I should avoid it. My understanding was that the next two
approaches are identical wrt to the protocol, as in both, the client
will connect to the rsync server over tcp/ip instead of pipes (no
remote shell involved). But you were saying that the 3rd one also
involves using pipes, just like the 1st one, right? Could you please
confirm again? Doesn't the below from man rsync page mean otherwise?

       From the user's perspective, using rsync in this way  is  the  same  as
       using it to connect to an rsync server, except that you must explicitly
       set the remote shell program on the command  line  with  --rsh=COMMAND.
       (Setting RSYNC_RSH in the environment will not turn on this functional-

I was able to successfully try the 2nd apporach by first starting
rsync as a daemon on the remote server, with both host::module and
rsync://host/module style paths. What I had trouble was trying the 3rd
one, though it may not be what I finally want (as you indicated
earlier that it will suffer from the same hang problem). Could you
just tell me the command-line equivalent of the below two for using
the 3rd form above?

$ rsync --rsh=ssh -av hkrishna:/temp/rsync/r1/ /temp/rsync/r2/

2nd: The man pages seem to indicate, both host::module and
rsync://host/module are identical/interchangeable, is it not true?
$ ssh hkrishna cat /etc/rsyncd.conf
    comment = A module to test the daemon
    path = /temp/rsync
    read only = true
$ ssh hkrishna rsync --daemon
$ rsync -av rsync://hkrishna/temp/r1/ /temp/rsync/r2/
$ rsync -av hkrishna::temp/r1/ /temp/rsync/r2


I tried the below:

$ rsync -av --rsh=ssh hkrishna::temp/r1/ /temp/rsync/r2/

but this gave me the below error:

rsync: unable to open configuration file "rsyncd.conf": No such file or director
rsync error: syntax or usage error (code 1) at /home/lapo/packaging/tmp/rsync-2.
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at /home/lapo/packagi

How do i pass the configuration file location in this case? 

Another reason for my confusion is the same 3rd method, "RUNNING AN
RSYNC SERVER OVER A REMOTE SHELL PROGRAM" is described differently in
the man page for rsyncd.conf. Here is an excerpt:

       If rsync is run with both the --daemon and --rsh (-e) options, it  will
       spawn an rsync daemon using a remote shell connection.  Several config-
       uration options will not be available unless the remote  user  is  root
       (e.g.  chroot,  setuid/setgid,  etc.).   There  is no need to configure
       inetd or the services map to include the rsync server port if  you  run
       an rsync server only via a remote shell program.

It seems to clearly indicate (to me) that when I specify "--daemon
--rsh=ssh", it will take care of starting remote rsync in "daemon"
mode (which implies to me that it will not use pipes). It also talks
about not needing to configure inetd, again implying they are
equivalent. But passing "--daemon --rsh=ssh" always started a local
daemon, not a remote one.

I hope someone can now understand what my confusion is and what I am
trying to clarify here :)

Thanks a lot,

More information about the rsync mailing list