Gentoo Logo
Gentoo Spaceship

Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-mirrors
Lists: gentoo-mirrors: < Prev By Thread Next > < Prev By Date Next >
To: gentoo-mirrors@g.o
From: Tobias Klausmann <klausman@...>
Subject: Re: chroot() and broken logging with rsyncd
Date: Tue, 7 Dec 2004 13:59:05 +0100

On Sat, 06 Nov 2004, Tobias Klausmann wrote:
> The problem is this: rsyncd logs various stuff after chrooting
> (for example the "wrote X  read Y total size Z" line.
> Unfortunately, at this point /etc/localtime is inaccesible,
> resulting in UTC times being used. Other log lines (most notably
> the per -session "rsync on gentoo-portage from NAME (IP)" are
> written *outside* the chroot(), resulting in localized times.
> At first I thought this might be fixed by using syslog logging,
> but as the syslog call is used (i.e. not syslog-over-UDP) , the
> problem remains.
> So I thought, I'd deactivate chroot()ing in order to narrow down
> the problem. And bing: using use chroot=false "fixes" the
> timestamps. 
> Loging with broken timestamps is damn near unusable, so what
> should we do about it? I've written to the rsync maintainers (via
> their mailing list) but got no feedback whatsoever :-(

After finally devoting some time to thinking about it, I have a
solution: just add an appropriate etc/localtime to your rsync
tree (where the chroot happens). You have to do a little more
stuff, though, otherwise people will get that file/dir when
they sync. Hence:

- Change your syncing job to exclude your timezone file. In my
  case, it now reads:
  rsync -rlptDvz --exclude /etc --delete \
    rsync:// /var/rsync/gentoo/
  Note the "--exclude /etc" part. Excludes are always relative 
  the published tree.
  This prevents your half-hour sync from nuking your localtime

- Change your rsyncd.conf to exclude the same tree (People out
  there probably don't care much about it :)

  My config looks like this:

	motd file = /etc/rsync/rsyncd.motd
	log file  = /var/log/rsync.log
	pid file  = /var/run/
	timeout = 150
		path = /var/rsync/gentoo
		comment = Gentoo Linux Portage tree (deprecated)
		use chroot = true
		exclude = /etc
		path = /var/rsync/gentoo
		comment = Gentoo Linux Portage tree 
		use chroot = true
		exclude = /etc

Note the two exclude= lines. Again, those includes are relative
to the specified path.

- Restart your rsync daemon (in case you don't use inetd

- Now copy your /etc/localtime to your tree, in my case that's

Voilá! Correct timestamps and chroot() working as expected.

Hope this helps people who've had the same trouble as I did.

Tobias (

PS: When will gentoo-x86-portage be phased out for good?

export DISPLAY=vt100

gentoo-mirrors@g.o mailing list

chroot() and broken logging with rsyncd
-- Tobias Klausmann
Lists: gentoo-mirrors: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
chroot() and broken logging with rsyncd
Next by thread:
Previous by date:
Re: Configuration Request
Next by date:
some 2004.3 housecleaning

Updated Jun 17, 2009

Summary: Archive of the gentoo-mirrors mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.