pre-xfer exec fails in FreeBSD
forgetful tan
forgetful_tan at 163.com
Thu Feb 1 16:47:04 GMT 2007
On Thu, 1 Feb 2007 17:07:53 +0100
Paul Slootman <paul at debian.org> wrote:
> On Thu 01 Feb 2007, forgetful tan wrote:
> >
> > I want to use pre-xfer exec function in rsync for permition checking. In my Linux boxes, it successed. But today, I tried to put them in my FreeBSD box, it failed.
> > I've checked the log, but found the pre-xfer exec returns always be -1, which means waitpid failed to get the return status. After doing a little ugly patch for the wait_process function as follow, pre-xfer works again.
> >
> > --- main.c Thu Feb 1 22:42:23 2007
> > +++ main.c.orig Sat Oct 14 07:46:32 2006
> > @@ -103,10 +103,7 @@
> > * remember_children(), we succeed instead of returning an error. */
> > pid_t wait_process(pid_t pid, int *status_ptr, int flags)
> > {
> > - pid_t waited_pid;
> > - do {
> > - waited_pid = waitpid(pid, status_ptr, flags);
> > - } while (errno == EINTR);
> > + pid_t waited_pid = waitpid(pid, status_ptr, flags);
>
> The diff is a bit bigger than necessary...
> Anyway, the while should probably have been:
>
> } while (waited_pid < 0 && errno == EINTR);
>
> I see that in the latest CVS version, it is (or at least the same idea).
>
>
> Apart from that, if the exec always returns -1, then it's simply
> failing, and removing the loop here can't make much of a difference.
No, the -1 of status is not returned by the exec process, but the waitpid(2) in
here and in the system(3) call do. I've done above and the problem gone away.
> So, I'm wondering whether something else is going on.
> You failed to mention the rsync version, and what exactly your config is
My rsync is 2.6.9 released version, running in FreeBSD 5.4 .
The same config and rsync works in my debian Linux not matter "sarge" or "etch" .
Though I'm not sure why Linux do not have problem running the configure, I guess
that's coz by the different of signal handling between Linux and FreeBSD.
> (for amongst others the pre-xfer stuff).
just as
pre-xfer exec = /usr/local/bin/prexfer_test.sh
the shell script as follow :
#!/bin/sh
env >> /var/log/prexfer_test.log
exit 0
>
>
>
> Paul Slootman
> --
> To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
>
--
forgetful tan <forgetful_tan at 163.com>
More information about the rsync
mailing list