Ticket #221 (new enhancement)

Opened 5 years ago

Last modified 5 years ago

Avahi logs are shown with GMT timezone instead of system one

Reported by: pacho Owned by: lennart
Milestone: Component: avahi-daemon
Keywords: Cc:

Description

I have GMT+2 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

I am suffering this under Gentoo with 0.6.22, but I have seen other people with same problem under ubuntu:  http://ubuntuforums.org/showthread.php?t=40276

Thanks a lot

Change History

Changed 5 years ago by tedp

Do you have any other apps logging to /var/log/messages? Are their timezones similarly affected?

What is the output of TZ= date -- that will be the timezone that the system is on. That will be the timezone syslog is using (syslog writes to /var/log/messages on behalf of apps like Avahi).

On Debian/Ubuntu? you can run tzselect to adjust the system's timezone. Not sure about Gentoo.

The ubuntuforums thread you posted is just talking about the "-- MARK --" entries, not timezones. Did you mean to link to a different thread?

Changed 5 years ago by pacho

Sorry, I mean  http://ubuntuforums.org/showthread.php?t=735583

Seems that, at least on my system, only avahi is using GMT

$ date lun jul 14 14:40:46 CEST 2008 $ TZ= date -- lun jul 14 12:41:21 UTC 2008

Under Gentoo timezone is set under /etc/conf.d/clock file, I have set it to "Europe/Madrid?", also my /etc/localtime is pointing to Madrid timezone

Thanks :-)

Changed 5 years ago by lennart

  • priority changed from major to minor
  • type changed from defect to enhancement
  • component changed from avahi-core to avahi-daemon

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 think it would make sense that avahi did this copying by itself. That's why I will leave this bug open as wishlist.

Changed 5 years ago by pacho

Thanks a lot for explanation :-)

I have copied /etc/localtime to /etc/avahi/etc/localtime and now works ok. I have also reported it downstream:  http://bugs.gentoo.org/show_bug.cgi?id=231857

Thanks

Note: See TracTickets for help on using tickets.