GNOME Bugzilla – Bug 648556
Date and Time application doesn't correctly control the ntpd service
Last modified: 2011-05-04 15:48:49 UTC
I'm performing the Fedora 2011-04-21 GNOME3 test day. Upon executing this test: https://fedoraproject.org/wiki/QA:Testcase_desktop_date, I encountered the following: NTP button in Control Center's Date and Time application doesn't turn off the ntpd service. Running 'service ntpd status' shows that ntpd is still running. Also, after waiting for ~1/2 minute, the NTP button automatically switches to ON position again (which reflects the true status of ntpd). The same thing holds in reverse, when the ntpd is disabled and the user tries to use the Control Center's Date and Time application to turn it on. system-config-date works fine. Versions of selected components: control-center-3.0.0.1-3.fc15.x86_64 ntp-4.2.6p3-3.fc15.x86_64
Fixed on master and gnome-3-0 commit 4d980c885afaadae455f4c24fedefa7026e8beec Author: Bastien Nocera <hadess@hadess.net> Date: Thu Apr 28 15:43:56 2011 +0100 datetime: Fix setting NTP on Fedora 15 https://bugzilla.gnome.org/show_bug.cgi?id=648556
Test packages at: http://koji.fedoraproject.org/koji/taskinfo?taskID=3032970 Let me know if those work, and I'll push them into Fedora 15.
I tried the packages and looked at your commit. From what I can understand, it still doesn't achieve the desired behavior. Let me explain how I see the expected behaviour of the NTP button: - Clicking ON should have two immediate effects: (1) start the ntpd service, (2) enable it on future start-ups. In systemd's terms: "systemctl start foo.service" "systemctl enable foo.service" - Clicking OFF should have the reverse effects, namely: "systemctl stop foo.service" "systemctl disable foo.service" What do you think?
(In reply to comment #3) > I tried the packages and looked at your commit. > From what I can understand, it still doesn't achieve the desired behavior. > > Let me explain how I see the expected behaviour of the NTP button: > - Clicking ON should have two immediate effects: > (1) start the ntpd service, > (2) enable it on future start-ups. > In systemd's terms: > "systemctl start foo.service" > "systemctl enable foo.service" > > - Clicking OFF should have the reverse effects, namely: > "systemctl stop foo.service" > "systemctl disable foo.service" > > What do you think? If chkconfig (without the --level) and service don't work, then there's a bug there, or in systemd, not for us. Lennart is the one that told me what to do in the patch, so if it doesn't work as expected, Lennart is to blame...
I digged deeper into the issue and discovered that using the NTP ON and OFF buttons correctly sets the ntpd service to start / not start on boot (I used the "ls /etc/systemd/system/*.wants/ntpd.service" command, as suggested in http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet). However, the buttons don't start/stop the ntpd service. I checked this via the "systemctl status ntpd.service" command. I looked at the gsd_datetime_mechanism_set_using_ntp function in plugins/datetime/gsd-datetime-mechanism.c and from what I can understand it should use the "/sbin/service ntpd restart" and "/sbin/service ntpd stop" to start / stop the ntpd service. And manually using that commands, indeed, works as expected. How can see what the gnome-setting-daemon is doing and where it is failing?