Timing of ntpd startup

This forum is for discussion about general software issues.

Timing of ntpd startup

Postby woody » Wed Jun 04, 2014 10:13 pm

I'm running a Pogoplug V2, which does not have a hardware clock. I have various processes that are kicked off by systemd service files, including an ntpd.service which starts ntpd and syncs the system clock. When I look at the systemctl status for these processes, I see that they have launched before ntpd has had a chance to update the time, so they get a default start date of 1969.

I've tried various things to try to make sure that ntpd.service can complete before the other processes launch, including running ntp-wait.service, which is supposed to delay it's completion until ntpd is up and running. I make my processes dependent on ntp-wait.service, but they still appear to start before ntpd has completed its update.

Has anybody devised a solution for this problem?
woody
 
Posts: 88
Joined: Tue Dec 11, 2012 2:40 pm

Re: Timing of ntpd startup

Postby WarheadsSE » Wed Jun 04, 2014 11:19 pm

pacman -Ss fakeclock

And obviously, *some* services will not be able to be started *after* the network, since the network needs them.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Timing of ntpd startup

Postby woody » Thu Jun 05, 2014 2:36 pm

I think the package is called fake-hwclock. That's not a perfect solution, but it might be the best bet. I've installed it and I'll see how it works.

Thanks for the suggestion!
woody
 
Posts: 88
Joined: Tue Dec 11, 2012 2:40 pm

Re: Timing of ntpd startup

Postby kotrfa » Mon Jun 09, 2014 7:12 am

fake-hwclock didn't worked for me. It is still to late for it in boot process, so there is same bunch of units from 1970 as only with ntp.

I'd recommend you using systemd-timesyncd, which not only replaces fake-hwclock, but it also can replace ntp.
kotrfa
 
Posts: 7
Joined: Fri Jun 06, 2014 8:14 pm

Re: Timing of ntpd startup

Postby WarheadsSE » Mon Jun 09, 2014 1:42 pm

How does this replace what fake-hwclock ?

EDIT
Found this in the quote from your other post:
$this->bbcode_second_pass_code('', 'Jan 01 01:00:06 smecpi systemd-timesyncd[125]: System clock time unset or jumped backwards, restoring from recorded timestamp: Sun 2014-06-08 16:48:35 CEST
Jun 08 16:48:35 smecpi systemd[1]: Started Network Time Synchronization.')

Now if only it didn't stop sync'ing..
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Timing of ntpd startup

Postby woody » Mon Jun 09, 2014 3:46 pm

Ok, I did some reading about this and there are several things I don't understand:

1. Why does systemd-timesyncd succeed in updating the system time before the other processes launch when ntpd doesn't?

2. Is it possible to run both systemd-timesyncd and ntpd at the same time? If so, maybe it would be possible to launch systemd-timesyncd as a "one-shot", then let ntpd do the regular time syncing.

3. Any advantage of using systemd-timesyncd instead of ntpd?

4. I read some users say that they had to install systemd-networkd to get systemd-timesyncd to work. That seems like it might open up a whole new set of problems, unless there's some other good reason to do it.

Any thoughts about this?
woody
 
Posts: 88
Joined: Tue Dec 11, 2012 2:40 pm

Re: Timing of ntpd startup

Postby calzon65 » Mon Jun 09, 2014 7:14 pm

I am also curious about your question 3 (systemd-timesyncd versus ntpd). I am trying to determine which method of time sync is the "Arch way" so I can be compliant with the direction of Alarm.
calzon65
 
Posts: 80
Joined: Wed May 25, 2011 9:06 pm

Re: Timing of ntpd startup

Postby kotrfa » Sun Jun 29, 2014 3:58 pm

Sorry for late answer.

@woody:
1. It doesn't. But it does it much better than ntpd out-of-the-box. I guess it has higher priority, since it is part of a systemd.

2. I think it can. I don't know why they should conflict - but I can't think of a reason why you would do it.

3. You don't have to have two separate packages (and units/daemons) to make two related things (fake-hwclock and ntp). I believe it gets better support, since it is part of systemd.

4. Yes, you have to (it is undocumented "feature"...) . You don't have to install it separately, because you should already have it. You have to only enable it. And there are no problems at all, because there are no default profiles for connections. It is running on all of my arch installations next to netctl or wicd without problems.
I didn't want to have it just "running for nothing", so I migrate from netctl to systemd-networkd. I wrote a little tutorial for my friends here, if you like. Navigate yourself into network configuration in RPi section.

Don't hesitate to ask for some additional logs or testing.
Last edited by kotrfa on Sat Jul 05, 2014 6:04 pm, edited 2 times in total.
kotrfa
 
Posts: 7
Joined: Fri Jun 06, 2014 8:14 pm

Re: Timing of ntpd startup

Postby woody » Mon Jun 30, 2014 3:53 pm

Thanks! That's some very useful information.
woody
 
Posts: 88
Joined: Tue Dec 11, 2012 2:40 pm


Return to General

Who is online

Users browsing this forum: No registered users and 36 guests