After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 648556 - Date and Time application doesn't correctly control the ntpd service
Date and Time application doesn't correctly control the ntpd service
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: general
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-24 14:03 UTC by Tadej Janež
Modified: 2011-05-04 15:48 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tadej Janež 2011-04-24 14:03:16 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
Comment 1 Bastien Nocera 2011-04-28 14:53:14 UTC
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
Comment 2 Bastien Nocera 2011-04-28 15:11:22 UTC
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.
Comment 3 Tadej Janež 2011-05-04 14:07:25 UTC
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?
Comment 4 Bastien Nocera 2011-05-04 14:14:18 UTC
(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...
Comment 5 Tadej Janež 2011-05-04 15:48:49 UTC
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?