[systemd-devel] timezone aware timers

Lennart Poettering lennart at poettering.net
Tue Feb 20 17:37:59 UTC 2018


On Di, 20.02.18 11:20, Dan Nicholson (nicholson at endlessm.com) wrote:

> On Tue, Feb 20, 2018 at 11:04 AM, Lennart Poettering
> <lennart at poettering.net> wrote:
> > On Di, 20.02.18 11:14, Iain Lane (iain at orangesquash.org.uk) wrote:
> >
> >> I also don't know how we'd get notified of the timezone changing.
> >> inotify on /etc/timezone?
> >
> > /etc/timezone is usually a symlink, and iirc we can't install inotify
> > on a symlink (only in the containing dir, but that means a lot more
> > wakeups).
> 
> Drive-by comment: the file you want to watch is /etc/localtime. That's
> what glibc reads to get the default timezone in preference to the $TZ
> environment variable -
> http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html.
> /etc/timezone is just a Debian thing to keep the name of the timezone.
> I'm not sure what uses that file.

True, we dropped /etc/timezone a long time ago. /etc/localtime is the
way to go, and the timezone is supposed to be read from the symlink
content.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list