Time entries in rsync log

Wayne Davison wayned at samba.org
Mon Jul 3 20:48:20 GMT 2006


On Mon, Jul 03, 2006 at 01:09:35PM +0300, Mark, Oren wrote:
> The first entry in the correct time and second is strange.

This usually indicates that you have "use chroot = yes" and your C
library doesn't remember the timezone prior to the chroot() occurring.
The code in CVS (which will go into 2.6.9) attempts to work around this
problem by ensuring that strftime() gets called prior to the chroot()
call.  So, it you might want to try using the CVS version or the
attached patch on your current rsync version to see if the problem goes
away.

Another possible solution is to set the TZ environment variable outside
of rsync so that the C library can determine the timezone when the
/etc/timezone file is not present.  

..wayne..
-------------- next part --------------
--- log.c	25 Apr 2006 23:51:15 -0000	1.146
+++ log.c	3 May 2006 06:06:19 -0000
@@ -154,17 +154,14 @@ static void logfile_open(void)
 
 void log_init(void)
 {
-	time_t t;
-
 	if (log_initialised)
 		return;
 	log_initialised = 1;
 
 	/* this looks pointless, but it is needed in order for the
 	 * C library on some systems to fetch the timezone info
 	 * before the chroot */
-	t = time(NULL);
-	localtime(&t);
+	timestring(time(NULL));
 
 	/* optionally use a log file instead of syslog */
 	logfname = lp_log_file();


More information about the rsync mailing list