[Bug 773491] New: Timezone is not sync with Yast timezone
https://bugzilla.novell.com/show_bug.cgi?id=773491 https://bugzilla.novell.com/show_bug.cgi?id=773491#c0 Summary: Timezone is not sync with Yast timezone Classification: openSUSE Product: openSUSE 12.2 Version: RC 1 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: GNOME AssignedTo: bnc-team-gnome@forge.provo.novell.com ReportedBy: bili@suse.com QAContact: qa-bugs@suse.de Found By: --- Blocker: --- Created an attachment (id=500313) --> (http://bugzilla.novell.com/attachment.cgi?id=500313) The screenshot for different timezone After I change the time in 'System Setting', after reboot the change dismiss. And I check the Timezone in Yast find it's still Beijing, but I changed the timezone in "System Setting" to 'London'. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c1
Vincent Untz
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c
kk zhang
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c
Thomas Göttlicher
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c2
Jiří Suchomel
My guess is that YaST relies on some field in sysconfig and blindly trusts it, while it shouldn't.
Indeed. But so far, nobody complained. How exactly does GNOME system settings recognize (and save) current time zone? For example with the 'date +%Z', I get correct offset, but not the exact timezone as saved by YaST. Does GNOME make a symlink of /etc/localtime, so I can see where is it pointing to? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c3
Vincent Untz
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c4
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c6
Li Bin
Seems like write function uses symlink.
So, question for Bin Li:
- what is the content of your /etc/timezone? This file doesn't exist.
- is your /etc/localtime symbolic link, and if so, where does it point to? (I'm hoping that it should point to /usr/share/zoneinfo/Europe/London)
$ l /etc/localtime -rw-r--r-- 5 root root 311 Jul 25 22:41 /etc/localtime It's not a symbolic link. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c7
--- Comment #7 from Li Bin
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c8
--- Comment #8 from Li Bin
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c9
Jiří Suchomel
- what is the content of your /etc/timezone? This file doesn't exist.
Strange. Vincent, are you maintainer of this part of systemd? Or Frederic, are you? write_data_timezone from timedated.c should write /etc/timezone, right? The read function seems to rely on it, so why wasn't it written? And another part: (In reply to comment #7)
Now I'm in Beijing, and I change the Timezone to Beijing in Yast. But the timezone in 'System Settings' still in 'Europe/London'
YaST adapts sysconfig value AND /etc/localtime as well. Why System settings does not read it correctly? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c10
--- Comment #10 from Li Bin
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c11
Vincent Untz
(In reply to comment #6)
- what is the content of your /etc/timezone? This file doesn't exist.
Strange. Vincent, are you maintainer of this part of systemd? Or Frederic, are you?
I'm not, I guess it's Frédéric then.
write_data_timezone from timedated.c should write /etc/timezone, right? The read function seems to rely on it, so why wasn't it written?
Not sure, it should write it, indeed.
And another part:
(In reply to comment #7)
Now I'm in Beijing, and I change the Timezone to Beijing in Yast. But the timezone in 'System Settings' still in 'Europe/London'
YaST adapts sysconfig value AND /etc/localtime as well. Why System settings does not read it correctly?
The GNOME tools just fetch the timezone from timedated. And timedated apparently only reads /etc/timezone (see the read_data function() from http://cgit.freedesktop.org/systemd/systemd/tree/src/timedate/timedated.c) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c12
Jiří Suchomel
Now I'm in Beijing, and I change the Timezone to Beijing in Yast. But the timezone in 'System Settings' still in 'Europe/London'
YaST adapts sysconfig value AND /etc/localtime as well. Why System settings does not read it correctly?
The GNOME tools just fetch the timezone from timedated. And timedated apparently only reads /etc/timezone (see the read_data function() from http://cgit.freedesktop.org/systemd/systemd/tree/src/timedate/timedated.c)
Yes, I've seen this. But is /etc/timezone mandatory? YaST does not save it and time setting works correctly for years... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c13
--- Comment #13 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c14
Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c15
--- Comment #15 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c16
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c17
Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c18
--- Comment #18 from Jiří Suchomel
... And the code proposed relies on the symlink information to guess the timezone name. So, it might be better to switch to symlink when it is modified by YaST
YaST does not modify the file directly, but calls zic. I think zic copies /etc/localtime file, does not symlink it. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c19
--- Comment #19 from Frederic Crozat
(In reply to comment #17)
... And the code proposed relies on the symlink information to guess the timezone name. So, it might be better to switch to symlink when it is modified by YaST
YaST does not modify the file directly, but calls zic. I think zic copies /etc/localtime file, does not symlink it.
This is from a patch we added in 2010 (timezone package): Tue Aug 24 12:11:51 CEST 2010 - pbaudis@suse.cz - Make zic -l do a copy when hardlinking fails (e.g. because /usr being on a separate partition) [bnc#607532] I'm pretty sure we can drop it, since /usr is now mounted in initrd. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c20
Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c21
--- Comment #21 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c22
--- Comment #22 from Jiří Suchomel
on the other hand this does not show the real timezone file with some bash code it should be easy to find the file
md5=($(md5sum /etc/localtime)) for f in $(find /usr/share/zoneinfo/ -type f); do set -- $(md5sum $f) test $md5 = $1 && break fi echo $f
Several files under /usr/share/zoneinfo/ have same md5 sum. This explains why, after I chose Europe/Prague in (this time KDE) destktop tool, it showed me Europe/Bratislava next time. Although the time is correct, I still think it is not correct behavior. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c23
--- Comment #23 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c24
--- Comment #24 from Frederic Crozat
(In reply to comment #19)
No apply is OK but drop before the SLES12 is out there we should not do as we may fall back if some big vendors insist on a separate /usr parition ... and just for the case of doing an update fdrom SLES11 to SLES12 with an existing /usr parition
Well, since we still support /usr on a separate partition (it is handled in initrd and not at the initial boot), it could continue to work as expected. What we can do is no longer apply the patch, starting with openSUSE 12.2.
(In reply to comment #22) (In reply to comment #20)
on the other hand this does not show the real timezone file with some bash code it should be easy to find the file
md5=($(md5sum /etc/localtime)) for f in $(find /usr/share/zoneinfo/ -type f); do set -- $(md5sum $f) test $md5 = $1 && break fi echo $f
Several files under /usr/share/zoneinfo/ have same md5 sum. This explains why, after I chose Europe/Prague in (this time KDE) destktop tool, it showed me Europe/Bratislava next time.
Although the time is correct, I still think it is not correct behavior.
Then we need to keep the name of the timezone somewhere. Either in /etc/sysconfig/clock or as part of the symlink name for /etc/localtime -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c25
--- Comment #25 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c26
--- Comment #26 from Frederic Crozat
(In reply to comment #24)
Hmmm ... if we support separate /usr then hadlinks are a nogo.
agreed, better to use symlink and rely on /usr being mounted by initrd (not for SLE11, of course, where we should stick to copying the file). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c27
--- Comment #27 from Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c28
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c29
Dr. Werner Fink
From my point of view the maintainer of the corresponding package
rpm -qf /usr/sbin/zic timezone-2009d-0.1 maintainer timezone bugowner of Base:System/timezone -- pbaudis@novell.com
welcome Petr :) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c30
--- Comment #30 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c
kk zhang
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c
Michal Filka
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c33
Jiří Suchomel
the integration isn't perfect yet: when updating timezone in yast, timedated isn't aware of the change, if it was running before (not sure how to fix that properly, apart from restarting timedated using systemctl try-restart systemd-timedated.service)
You mean when zic is called from YaST? Should YaST do anything here? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c34
--- Comment #34 from Dr. Werner Fink
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c35
Frederic Crozat
(In reply to comment #32)
the integration isn't perfect yet: when updating timezone in yast, timedated isn't aware of the change, if it was running before (not sure how to fix that properly, apart from restarting timedated using systemctl try-restart systemd-timedated.service)
You mean when zic is called from YaST?
yes, because /etc/localtime is updated without systemd-timedated being aware of the change (if it was running, which isn't the case most of the time)
Should YaST do anything here?
I suggest adding a non-fatal call to "systemctl try-restart systemd-timedated.service" (In reply to comment #34)
(In reply to comment #33)
Sounds like a job for an inotfiy watch on /etc or /etc/localtime, in last case the watch has to restarted in case of changing the symlink.
But I'm not sure upstream will merge such patch, since they probably expect applications to use the D-Bus interface to access this file (with added benefits of D-Bus change event of other applications listening for it). I'll ask them. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c36
--- Comment #36 from Jiří Suchomel
Should YaST do anything here?
I suggest adding a non-fatal call to "systemctl try-restart systemd-timedated.service"
OK, I'll add it just after the zic call. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c37
--- Comment #37 from Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c38
--- Comment #38 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c39
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c40
--- Comment #40 from Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c41
--- Comment #41 from Jiří Suchomel
I have done the sr yet, waiting for feedback, but got none so far..
Should the reported test your packages? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c42
--- Comment #42 from Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c
Jiří Suchomel
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c44
--- Comment #44 from Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c46
--- Comment #46 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c47
--- Comment #47 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c48
--- Comment #48 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c49
--- Comment #49 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c50
--- Comment #50 from Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c51
--- Comment #51 from Swamp Workflow Management
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c52
Li Bin
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c53
--- Comment #53 from Bernhard Wiedemann
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c54
--- Comment #54 from Michael Catanzaro
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c55
--- Comment #55 from Frederic Crozat
I kind-of forgot about the systemd patch for 12.2
Is it really needed ? I doubt it's needed; I don't know who all consumes timedated in 12.2, but I'm only aware of gnome-control-center and timedatectl. timedatectl is still royally broken, but it will be even with this patch (Bug #803644), and it's not
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c56
--- Comment #56 from Michael Catanzaro
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c57
Frederic Crozat
https://bugzilla.novell.com/show_bug.cgi?id=773491
https://bugzilla.novell.com/show_bug.cgi?id=773491#c58
--- Comment #58 from Bernhard Wiedemann
participants (1)
-
bugzilla_noreply@novell.com