Timezone error with chrooted rsync version 2.6.3pre1

Wayne Davison wayned at samba.org
Sat Jan 15 19:06:20 GMT 2005


On Wed, Jan 12, 2005 at 11:56:24PM +0100, Eberhard Moenkeberg wrote:
> I am not sure it this still is a point, but I just discovered that a 
> chrooted rsync version 2.6.3pre1 is forgetting the time zone underways:
> [...] Logging is done with syslog.

I have tested 2.6.3 on my Debian Sarge box w/rsync 2.6.3, and I cannot
reproduce this (yes, my clock is set to UTC).  I normally have "TZ"
defined in my environment ("PST8PDT"), but unsetting this had no effect.
I tested both syslog and direct logging.

Note that rsync does nothing to manipulate the timezone directly, but it
does ensure that log_init() is called prior to calling chroot(), and
this ensures that one call to localtime() occurs before the chroot()
(which should load the timezone for any future calls) and that openlog()
gets called (to initialize any syslog() calls to follow).

> Jan 12 07:00:01 ftp4 rsyncd[11091]: rsync on dobes/ from dobes at edoc1.gwdg.de (134.76.28.251) 
> Jan 12 06:00:39 ftp4 rsyncd[11091]: wrote 732542 bytes  read 182 bytes  total size 553909487945 

FYI, *both* those log lines get output *after* chroot() gets called.  So
there has to be something else besides chroot() that is the real culprit
in the loss of the timezone on this system.  I'd recommend upgrading to
2.6.3 and see if the problem persists.  If so, the only other thing I
can think to try is to run the daemon under something like valgrind and
see if it reports any memory-access problems on your system (you might
want to try this with the current 2.6.3pre1 too):

    valgrind rsync --daemon --no-detach

I've run this command in my setup, and it reports no errors.

..wayne..


More information about the rsync mailing list