FS#30220 - [networkmanager-dispatcher-ntpd] systemd support (patch included)
Attached to Project:
Community Packages
Opened by Swift Geek (swiftgeek) - Saturday, 09 June 2012, 17:03 GMT
Last edited by Jelle van der Waa (jelly) - Thursday, 06 September 2012, 09:07 GMT
Opened by Swift Geek (swiftgeek) - Saturday, 09 June 2012, 17:03 GMT
Last edited by Jelle van der Waa (jelly) - Thursday, 06 September 2012, 09:07 GMT
|
Details
Added support for systemd via use of `ps -p 1 ch -o cmd`
Works fine with e4rat ;) http://pastebin.com/THUNkNC4 |
This task depends upon
Closed by Jelle van der Waa (jelly)
Thursday, 06 September 2012, 09:07 GMT
Reason for closing: Fixed
Additional comments about closing: fixed in -4
Thursday, 06 September 2012, 09:07 GMT
Reason for closing: Fixed
Additional comments about closing: fixed in -4
http://pastebin.com/AdhnVgc9
https://bbs.archlinux.org/viewtopic.php?id=145010
And it works, also.
Also add that to pacman.conf:
NoUpgrade = etc/NetworkManager/dispatcher.d/10-ntpd
SetNTP() http://www.freedesktop.org/wiki/Software/systemd/timedated
And i'm not good with dbus (especially from scripts)
gdbus call --system --object-path /org/freedesktop/timedate1 --dest org.freedesktop.timedate1 --method org.freedesktop.timedate1.SetNTP true false
Anyone care to test? I don't use this stuff.
EDIT: works even without starting /usr/lib/systemd/system/systemd-timedated.service
EDIT2: updated script http://pastebin.com/AdhnVgc9
According to the limited information on the web, this thing should either:
- start the ntpd.service (or whatever configured)
OR
- start the ntpd.service just to set the time and then stop it and exit
It is not clear which one exactly.
And it doesn't seem to do either.
Here, timedated's NTP string is already set to true:
$ dbus-send --system --print-reply --dest=org.freedesktop.timedate1 /org/freedesktop/timedate1 org.freedesktop.DBus.Properties.GetAll string:org.freedesktop.timedate1
method return sender=:1.206 -> dest=:1.207 reply_serial=2
array [
dict entry(
string "Timezone"
variant string "Europe/Sofia"
)
dict entry(
string "LocalRTC"
variant boolean false
)
dict entry(
string "NTP"
variant boolean true
)
]
$
but ntpd.service is not engaged as supposed to when systemd-timedated.service is started.
Can you shine some light on the process, the expected and the achieved results, please.
1) network-manager supports dispatcher hooks to start/stop things on network up/down. This is what this hook is being abused for.
2) systemd-timedated allows applets to control time and date setting including use of an NTP daemon, over Dbus.
Really, these things are orthogonal.
In my opinion, this should be documented on the wiki and left at that. There's really strange behavior here like start/stop ntpd on vpn connection state. If you bring your VPN connection down but still have an internet connection, why should your ntpd turn off? Of course, maybe that makes sense for some people...
1. systemd-timedated.service is started
2. ntpd.service (or whatever else) is started by systemd-timedated.service
3. systemd-timedated.service is stopped after some short time
After passing this weird long command with false false
1. systemd-timedated.service is started
2. ntpd.service (or whatever else) is stopped by systemd-timedated.service
3. systemd-timedated.service is stopped after some short time
Thanks for the explanation.
I also can confirm that this thing works.
falconindy's argument about the VPN have merit, though.
EDIT: It was uploaded few hours later. It can be closed now