Solaris, socketpair and chroot
dwd at bell-labs.com
Thu Feb 28 06:32:08 EST 2002
On Wed, Feb 27, 2002 at 08:03:46AM -0700, Rusty Carruth wrote:
> Thomas Quinot <thomas at cuivre.fr.eu.org> wrote:
> > When using rsync 2.5.2 as daemon on a Solaris 2.5.1 box, I cannot
> > copy data to rsync volumes with option 'use chroot'; I get the
> > following messages on the client:
> > pipe failed in do_recv
> > rsync error: error in socket IO (code 10) at main.c(375)
> > rsync: connection unexpectedly closed (69 bytes read so far)
> > What seems to occur on the server is that socketpair(3)
> > (not pipe(2)) is called, which needs to open /dev/ticotsord.
> > Since I do not have a /dev in the chroot directory,
> > this call fails.
> Why not just make a /dev in the chroot and put only tioctsord
> (or whatever is needed) in there?
That wouldn't be very friendly to have to do for every module listed in
rsyncd.conf. It would be interesting to do for a test though just to make
sure that this is really the problem. I'm surprised that no-one else would
have reported this before. Surely it can't be needed on all versions of
> > Disabling HAVE_SOCKETPAIR in config.h seems to resolve the
> > problem. Is there any way this can be worked around more
> > appropriately (perhaps by calling socketpair() before going
> > chrooted)?
That seems reasonable except that it would be rather messy to implement
because the place where socketpair() is called now comes from several
places and only one of them calls chroot.
If it helps, a nice workaround to editting config.h might be to set
the environment variable "rsync_cv_HAVE_SOCKETPAIR=no" before calling
- Dave Dykstra
More information about the rsync