-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd timers treat all timezones as UTC #105049
Comments
Maybe our patch in |
Note that if I specify a timezone that doesn't exist, I get an error on activation. So presumably it can find the timezone info, it just doesn't respect it. |
Can you reproduce on non-NixOS? |
Nope, see the fourth bullet point under Additional context. |
I was able to reproduce this on NixOS, and verified it works correctly on Archlinux. I still don't understand why it behaves the way it does (it seems we did properly patch all occurences this might touch). This might require some deeper digging into the codebase, and adding some logs along the way to see what's going on. |
I marked this as stale due to inactivity. → More info |
Not stale, but help welcome ;-) |
I haven't had time to test this but a cursory reading of the systemd code shows that it uses https://github.com/systemd/systemd/blob/main/src/shared/calendarspec.c#L1411 tzset uses TZDIR. On a normal nixos system I get this:
but pid 1 doesn't set TZDIR:
|
I confirmed TZDIR is the issue by applying the following patch. I think my fix is wrong but I couldn't figure out where in systemd pid 1 I should set env vars so I did id in a function that I know will be called.
without patch:
with patch:
unit used:
|
Yeah, this looks about right. Maybe we should see if we can steer glibc to look for zoneinfo in these two paths by default, instead of in the glibc output directly.
|
Describe the bug
The
OnCalendar
field of systemd timer units is treated as UTC, even if a different timezone is specified.To Reproduce
systemctl status foo.timer
and observe that theTrigger
field says midnight UTC (in my case,Fri 2020-11-27 01:00:00 CET
).Expected behavior
In this case, the
Trigger
field should sayFri 2020-11-27 12:00:00 CET
(orFri 2020-11-27 11:00:00 UTC
).Additional context
systemd-analyze calendar "00:00:00 Pacific/Auckland"
on the same machine gives the correct result, so this is linked to timer units.Notify maintainers
@edolstra @andir @flokli @kloenk
Metadata
The text was updated successfully, but these errors were encountered: