You are not logged in.

#1 2012-10-10 15:28:10

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Systemd and hwclock

I've switched to systemd and am about 98% successful. The one thing that is nagging me is the hwclock deamon. What is replacing the standard DEAMONS (hwclock...) in a fully switched systemd implementation? I can't find anything related to hwclock in /lib/systemd/system that would run this on boot and shutdown...

The Arch Wiki on systemd states that "Recent kernels set the system time from the RTC directly on boot without using hwclock, the kernel will always assume that the RTC is in UTC." So, does this mean that hwclock should no longer be used? I have seen other distros (Mageia) create hwclock-load and hwclock-save services (https://bugs.mageia.org/show_bug.cgi?id=2521), but what's the correct method? Can someone advice?

Offline

#2 2012-10-10 16:47:04

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Systemd and hwclock

You could try hwclock --debug.
Systemd wants you to link ln -sf /usr/share/zoneinfo... to /etc/localtime


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2012-10-10 20:30:21

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: Systemd and hwclock

nomorewindows wrote:

You could try hwclock --debug.

I'm not sure what you mean by that. I believe hwclock itself works fine, but I'm wondering what systemd service is replacing the entry to rc.conf for DAEMONS (hwclock...), since in "pure" systemd, the rc.conf file is no longer used.

nomorewindows wrote:

Systemd wants you to link ln -sf /usr/share/zoneinfo... to /etc/localtime

Yes, I've done that. The only remaining question is how hwclock is invoked in the systemd scenario. Or is hwclock no longer needed?

Offline

#4 2012-10-10 20:35:18

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Systemd and hwclock

I'm having a fuss with it taking my clock correctly on machine.
Now I know what I'm doing, I'm using ntpd.service on the other machines, so I don't have to fuss with the clock.
Do a time sync with ntpdate <time.server.ip.address> to get the UTC to read the right time and then when you type date it should be your localtime.

Last edited by nomorewindows (2012-10-10 20:47:10)


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2012-10-10 21:02:08

progandy
Member
Registered: 2012-05-17
Posts: 5,180

Re: Systemd and hwclock

systemd includes code to set the clock, so no hwclock is required.
http://cgit.freedesktop.org/systemd/sys … 6e2428fd9b

PS: I'm using chrony on my laptop. It is more reliable than ntpd for me.

Last edited by progandy (2012-10-10 21:06:15)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#6 2012-10-10 21:04:24

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Systemd and hwclock

Anyhow, ntpd.service will set it right if you have a misfit windows to contend with, not allowing you to set your hardware clock to a sane UTC.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#7 2012-10-10 22:38:45

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: Systemd and hwclock

Yes, sorry, I wasn't clear on this - I *am* using NTP, but since this for a laptop I am also using NetworkManager and I'm starting NTP using networkmanager-dispatcher.

Now, in the Arch Wiki for NTP (https://wiki.archlinux.org/index.php/NTP), in the NetworkManager section, it states:

Note: ntpd should still be running when the network is down if the hwclock daemon is disabled, so you should not use this.

I read this as: make sure to run hwclock when you use NTP + NetworkManager.

But, based on this discussion: is the consensus is that with systemd we no longer need hwclock, also if you use NetworkManager?

By the way, when I was going through the (very good) documentation on the Arch Wiki / Forums on switching to systemd, I got stumped by my very first entry in the rc.conf, which was hwclock, for which there is no hwclock.service to convert to. We should probably mention in the Wiki that this one can be removed from rc.conf's DAEMONS array when switching to systemd.

Offline

#8 2012-10-11 00:02:17

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,362

Re: Systemd and hwclock

It's poorly worded.  I think it means that if ntpd is used it should remain running regardless of whether the network is up or down.
If the network is down, ntpd will be able to tell when it gets network errors, and it will just keep trying until it can update the time.
Hwclock might not "keep time".


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#9 2012-10-11 02:15:29

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: Systemd and hwclock

Okay - I won't worry about hwclock and see if there's time issues.

Interestingly enough, I noticed that the ntpd.service was "enabled" on my system. I don't recall enabling that, but perhaps I did. I disabled it, since I want NetworkManager to start it after it connects to a network. I assume that's the proper way of configuring it.

I read the note about Chrony. I'll see if this ntpd / NetworkManager in my systemd setup works, if not, I'll try out Chrony.

Offline

#10 2012-10-12 02:00:06

mynis01
Member
Registered: 2011-04-29
Posts: 71

Re: Systemd and hwclock

What I did, was just set up cron to run ntpd and sync my clock about 30 seconds after startup. I did this because otherwise it was interfering with fsck and making it think the last access time was in the future.

Offline

#11 2012-10-12 02:42:38

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: Systemd and hwclock

Yes, I also noticed (ironically) timing issues with when ntp is started. To not confuse this thread about hwclock, I started a new one here: https://bbs.archlinux.org/viewtopic.php?id=150504

Offline

Board footer

Powered by FluxBB