FS#31674 - [systemd] add hwclock.service
Attached to Project:
Arch Linux
Opened by Davorin Učakar (phantom) - Monday, 24 September 2012, 16:55 GMT
Last edited by Dave Reisner (falconindy) - Monday, 15 October 2012, 23:21 GMT
Opened by Davorin Učakar (phantom) - Monday, 24 September 2012, 16:55 GMT
Last edited by Dave Reisner (falconindy) - Monday, 15 October 2012, 23:21 GMT
|
Details
I see many people have problems with hw clock not
synchronising to system clock on shutdown, which results in
wrong time on next boot until time gets synchronised again.
Intscripts have `hwclock` script for this purpose.
I propose adding a unit `/usr/lib/systemd/system/hwclock.service`: [Unit] Description=Synchronise Hardware Clock to System Clock DefaultDependencies=no Before=shutdown.target [Service] Type=oneshot ExecStart=/sbin/hwclock --systohc [Install] WantedBy=reboot.target halt.target poweroff.target to either util-linux or systemd package. |
This task depends upon
Closed by Dave Reisner (falconindy)
Monday, 15 October 2012, 23:21 GMT
Reason for closing: Won't implement
Monday, 15 October 2012, 23:21 GMT
Reason for closing: Won't implement
That said, I think it is extremely unlikely to get this right (setting the time manually correctly with enough precission is problematic, the other problem is the coarseness of --adjust). A better solution is to use chrony which knows how to deal with the RTC in the absence of NTP and which is much more likely to get it right than any hack we can cook up (the only reason I kept the hwclock "daemon" as part of initscripts is so that we would not be any worse than we used to be, but should I have done it from scratch I would not have included it at all.