-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
changing timezones only works partially on linux 24.04 #21336
Comments
Indeed Debian carried a systemd patch to update /etc/timezone for many years (I was even part of that), but it was removed last year: https://salsa.debian.org/systemd-team/systemd/-/commit/5d4b34101117b9b9e64ecbc9b602113f91d4e837 "tzdata will no longer create it, we can just rely on /etc/localtime". Does it actually work to just remove it from your system? (Move it away so that you can restore it easily if it breaks Java) |
what do you mean remove it? try to completely remove /etc/timezone and where java will try and take timezone info? won't that brake other stuff in ubuntu? |
I'm no expert here, but Debian plans to remove /etc/timezone, see https://bugs.debian.org/822733. It was restored later on in https://tracker.debian.org/news/1421751/accepted-tzdata-2022g-6-source-into-unstable/ and the migration postponed to Debian 13. Hence I suggested trying what happens if you move it away now, if Java falls back to /etc/localtime. Fedora and RHEL haven't had /etc/timezone for many many years, and Java is definitively a thing for RHEL. So there's a good chance that it actually works. We will not change anything here in Cockpit -- either /etc/timezone is obsolete, and then the distributions will clean it up eventually (that seems to be the current plan); or it isn't, then that systemd patch should be restored. |
thanks, will try that , i have some back plan to try this as well, but i'm
not sure if there are any "hooks" scripts that are triggered when someone
changes a timezone, plus i have to figure why there are conflicts between
cockpit-bridge and cockpit-pcp too (according to apt at least, but that's
another story)
timedatectl show --property=Timezone --value | sudo tee /etc/timezone
/dev/null
sudo dpkg-reconfigure --frontend noninteractive tzdata
…On Thu, Nov 28, 2024 at 10:30 AM Martin Pitt ***@***.***> wrote:
I'm no expert here, but Debian plans to remove /etc/timezone, see
https://bugs.debian.org/822733. It was restored later on in
https://tracker.debian.org/news/1421751/accepted-tzdata-2022g-6-source-into-unstable/
and the migration postponed to Debian 13. Hence I suggested trying what
happens if you move it away now, if Java falls back to /etc/localtime.
Fedora and RHEL haven't had /etc/timezone for many many years, and Java is
definitively a thing for RHEL. So there's a good chance that it actually
works.
We will not change anything here in Cockpit -- either /etc/timezone is
obsolete, and then the distributions will clean it up eventually (that
seems to be the current plan); or it isn't, then that systemd patch should
be restored.
—
Reply to this email directly, view it on GitHub
<#21336 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADGP5MAWJQEIEOO5DT7RCML2C3ICXAVCNFSM6AAAAABSQY7DFCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBVGUZDQMJRGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
cockpit-pcp is obsolete, an upgrade should remove it (it got absorbed into cockpit-bridge) |
that seems to work too, but won't updating tzdata will automatically create this file? or do i need to remove tzdata too? |
Right, this was just a test, not a permanent solution for Ubuntu 22.04. I was mostly wondering if Java still needs /etc/timezone somehow (which would be a surprise, but you never know..)
Ugh no, this is very important. It's just /etc/timezone which is obsolete; /etc/localtime symlink and the actual time zone data continue to be (very) relevant. Thanks for checking! |
Sorry, you said 24.04, but same difference really -- Debian 13 will drop it, and some Ubuntu 25.XX or 26.XX will eventually inherit it. |
so basically i need to make sure /etc/timezone gets removed every time i start my java service |
i don't know exactly if this is a bug report or not.. but we've noticed that in ubuntu 24 changing the time zone doesn't seem to take effect in all places
for example doing timedatectl set-timezone don't seem to touch /etc/timezone which is what java takes it's values from by default in ubuntu it seems that dpkg-reconfigure tzdata is considered the standard way of doing things but i understand you guys are using dbus and systemd api's which means this wont' get affected.
The text was updated successfully, but these errors were encountered: