[systemd-devel] timezone aware timers

Iain Lane iain at orangesquash.org.uk
Tue Feb 20 11:14:51 UTC 2018


Hi systemd friends,

Sorry if this has been discussed already.

I'm working on an alarm program. To allow the program to be shut down
between alarms, they are represented as systemd timers using OnCalendar
specifications. This mostly works but I think there is one wrinkle
remaining - they don't handle timezone transitions but always trigger in
the timezone that was in use when they were started.

In addition to alarms, you might also want this to schedule housekeeping
tasks or backups to happen in the night. I think the semantics would be
something like -

  * When changing timezones, ensure timers will activate at their
    configured time in the new local timezone.
  * Ignore any activation times that are skipped over due to a timezone
    change.

I'm not sure, though, what the best way to specify this in a timer unit
would be. Perhaps either a new timezone specification "local", or a
boolean flag UpdateWithTimezoneChange. "local" would act like you
specified the current timezone, but we would go away and recalculate
the time on a timezone change.

I also don't know how we'd get notified of the timezone changing.
inotify on /etc/timezone?

WDYT? (Should I report this as an issue instead?)

Cheers,

-- 
Iain Lane                                  [ iain at orangesquash.org.uk ]
Debian Developer                                   [ laney at debian.org ]
Ubuntu Developer                                   [ laney at ubuntu.com ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180220/f589014f/attachment-0001.sig>


More information about the systemd-devel mailing list