I already reported this to upstream: http://avahi.org/ticket/221 I have GMT+1 as my timezone, but avahi logs in /var/log/messages are shown in GMT date instead. Seems that date is not being changed when avahi runs, simply is a problem showing logs Lennart explained me the cause: "Avahi runs in a chroot. Because libc works the way it works it needs /etc/localtime around for correct tz configuration. This is by default not available in the chroot. Which is usually not a problem, since most reasonable syslog implementations ignore the sender timestamps of local syslog clients anyway and always fill in the local reception timestamp instead. However, some of the crazier syslog implementations don't do this. Also, networked syslog doesn't (and shouldn't). I made downstream maintainers aware of this a while back. They should copy (or bind mount) /etc/localtime into the chroot before starting avahi. Please file a bug regarding this to your gentoo maintainers. Debian/Ubuntu and other distros do this properly." I simply copied /etc/localtime to /etc/avahi/etc/localtime and now is fixed (other option could be mount it with bind) Thanks a lot Reproducible: Always
Any news on this? Thanks
Is this so hard to fix? Maybe linking the file instead of copying it would be better... Thanks
(In reply to comment #2) > Is this so hard to fix? Maybe linking the file instead of copying it would be > better... > > Thanks > Symlinking won't work because then the actual contents of the file are outside the chroot jail and thus cannot be read. Adding "use_time_recvd(yes);" to the options section in /etc/syslog-ng/syslog-ng.conf seems to work to make syslog-ng report actual message receipt times rather than client reported times. Debian's syslog would appear to have this behavior by default.
(In reply to comment #3) > (In reply to comment #2) > > Is this so hard to fix? Maybe linking the file instead of copying it would be > > better... > > > > Thanks > > > > Symlinking won't work because then the actual contents of the file are > outside the chroot jail and thus cannot be read. > > Adding "use_time_recvd(yes);" to the options section in > /etc/syslog-ng/syslog-ng.conf seems to work to make syslog-ng report actual > message receipt times rather than client reported times. Debian's syslog > would appear to have this behavior by default. Will ask syslog-ng maintainer then
> > Symlinking won't work because then the actual contents of the file are > > outside the chroot jail and thus cannot be read. > > > > Adding "use_time_recvd(yes);" to the options section in > > /etc/syslog-ng/syslog-ng.conf seems to work to make syslog-ng report actual > > message receipt times rather than client reported times. Debian's syslog > > would appear to have this behavior by default. > > Will ask syslog-ng maintainer then Actually, I now suggest not relying only on use_time_recvd, since as Lennart notes there are cases where you don't want that (whether it's a good default or not). A different chrooted daemon on CentOS (BIND) does this in the init script: if [ -s /etc/localtime ]; then cp -fp /etc/localtime ${ROOTDIR}/etc/localtime fi And roughly the same for avahi-daemon. It's a bit ugly I suppose, but probably less so than a bind mount.
Pacho, I'm a bit confused about this bug. Do we still want to do this or not. Its a trivial fix, but I'm not sure given the comments about syslog-ng.
In fedora: http://pkgs.fedoraproject.org/cgit/avahi.git/tree/avahi.spec I see they are copying localtime inside chroot and, since they use systemd logging capabilities and Lennart is taking care of both, I guess current syslog behavior is not "so crazy" and we should do the changes in avahi instead of syslog-ng config