-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
/etc/timezone does not match host system #2190
Comments
What is /etc/timezone. I've never heard about that before, and I don't have it on my fedora system. Is it a debian thing? Is there some kind of standard defining how this works? |
Debian, but also apparently Arch (and possibly other distros) use it as well. It contains the name of the timezone in Olson format (e.g. "Europe/Prague") The problem is that Qt looks first for I could find only this: https://wiki.debian.org/TimeZoneChanges |
There is no |
Another alternative is to remove /etc/timezone from the runtime. It seems to be in the 1.6 freedesktop runtime, but not in the new (18.08) version. If that is not there, what does Qt use for timezone then? |
@alexlarsson It was already said that it falls back to |
I'm pretty sure it's not ancient: I had it on my Ubuntu 16.04 based system that I installed about 5 months ago - maybe it's created by some tool on boot? In any case, the KDE Runtime is based on freedesktop 1.6 at the moment, so the file is there - since this only seems to affect Qt apps, maybe we can remove it when building the KDE runtime for now. |
Its better to have all runtimes behave in the same way wrt something as core as timezone config i think |
It seems to me that Qt already prefers the /etc/localtime symlink value: However, I looked at both the Qt code and the glib code (https://gitlab.gnome.org/GNOME/glib/blob/master/glib/gtimezone.c#L406) and it seems that both rely on the symlink having a special format, which it doesn't at the moment. So, for the qt code it would work if we made the symlink be to like And, once we have to have a special value for the symlink in /etc then the monitor is starting to become less useful. Yes, the host might have more up-to-date timezone data than the runtime, but we can't update the symlink value at runtime when the user changes timezone... I wonder if we should instead just bind-mount the host zoneinfo over /usr/share/zoneinfo and just accept that you have to restart the app if you change timezone. Any other ideas? |
Alternatively, we could implement /etc/timezone in the monitor, and then patch the glib in the runtime to support that. Then we could support the timezone changing at runtime. Actually, glib already reads |
As |
This exposes a /etc/timezone with the current timezone, as per the old debian spec: https://wiki.debian.org/TimeZoneChanges In case we're using the session-helper this will be extracted from the host config and applied whenever that changes. Normally timezone info is specified by /etc/localtime being a symlink into the locale data, and you can look at the symlink value itself. However, in the sandbox we can't update a symlink in /etc at runtime, nor can we make it of the canonical form as that would point into the runtime. This is why /etc/timezone is used. This fixes flatpak#2190
@Erick555 it is redundant on the host, but we can't really implement it in the sandbox because it relies on pointing into /usr, which is in the runtime that flatpak has no guarantees about (i.e. it might not have the same timezone data as the host). Also, it has to be a direct symlink, which means we can only specify it at sandbox creation and never update it. That makes it not ideal for flatpak. |
@danvratil Whats your opinion on the approach in #2214 |
@alexlarsson Looks good. I tested it with the Kontact flatpak and the timezone was set correctly, so it definitely fixes the timezone issue for Qt/KDE apps. Thanks for fixing this so quickly. |
This exposes a /etc/timezone with the current timezone, as per the old debian spec: https://wiki.debian.org/TimeZoneChanges In case we're using the session-helper this will be extracted from the host config and applied whenever that changes. Normally timezone info is specified by /etc/localtime being a symlink into the locale data, and you can look at the symlink value itself. However, in the sandbox we can't update a symlink in /etc at runtime, nor can we make it of the canonical form as that would point into the runtime. This is why /etc/timezone is used. This fixes flatpak#2190
This exposes a /etc/timezone with the current timezone, as per the old debian spec: https://wiki.debian.org/TimeZoneChanges In case we're using the session-helper this will be extracted from the host config and applied whenever that changes. Normally timezone info is specified by /etc/localtime being a symlink into the locale data, and you can look at the symlink value itself. However, in the sandbox we can't update a symlink in /etc at runtime, nor can we make it of the canonical form as that would point into the runtime. This is why /etc/timezone is used. This fixes flatpak#2190 Closes: flatpak#2214 Approved by: alexlarsson (cherry picked from commit 0b6844f)
This exposes a /etc/timezone with the current timezone, as per the old debian spec: https://wiki.debian.org/TimeZoneChanges In case we're using the session-helper this will be extracted from the host config and applied whenever that changes. Normally timezone info is specified by /etc/localtime being a symlink into the locale data, and you can look at the symlink value itself. However, in the sandbox we can't update a symlink in /etc at runtime, nor can we make it of the canonical form as that would point into the runtime. This is why /etc/timezone is used. This fixes #2190 Closes: #2214 Approved by: alexlarsson (cherry picked from commit 0b6844f) Closes: #2237 Approved by: alexlarsson
This exposes a /etc/timezone with the current timezone, as per the old debian spec: https://wiki.debian.org/TimeZoneChanges In case we're using the session-helper this will be extracted from the host config and applied whenever that changes. Normally timezone info is specified by /etc/localtime being a symlink into the locale data, and you can look at the symlink value itself. However, in the sandbox we can't update a symlink in /etc at runtime, nor can we make it of the canonical form as that would point into the runtime. This is why /etc/timezone is used. This fixes #2190 Closes: #2214 Approved by: alexlarsson (cherry picked from commit 0b6844f)
Linux distribution and version
KDE neon Developer Edition 18.04 (Ubuntu Bionic)
Flatpak version
Flatpak 1.0.1
Description of the problem
/etc/timezone
inside the flatpak is always set to "Universal", so if the host system is configured to any other timezone, applications that depend on the timezone information will show wrong time.As suggested in flathub/org.kde.kontact#9, host
/etc/timezone
should be probably exposed to/run/host/monitor
.Steps to reproduce
Change your system timezone to anything other than UTC, run Kontact, observe wrong time (see
flathub/org.kde.kontact#9 for details)
The text was updated successfully, but these errors were encountered: