You are not logged in.

#1 2012-08-27 16:05:05

D4ve
Member
Registered: 2012-08-02
Posts: 209

[Solved] wlan0 and openntpd

Hi,

i recently switched to systemd as initprocess and have a little problem with my timezone, because openntpd is started before a wlan-connection is established.

Is there a workaround for this?

Before using systemd i had an entry in rc.local who started openntpd with a delay of 4 minutes and i know i can use rc.local with systemd, but i think it must be possible to have the established internetconnection as an dependency of openntpd.

Any help is appreciated smile

Last edited by D4ve (2012-08-27 21:10:57)

Offline

#2 2012-08-27 16:50:00

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [Solved] wlan0 and openntpd

There should be an option to have the NTP service launch only after the network has been brought up.

Actually, that's already the case:

$ cat multi-user.target.wants/ntpd.service 
[Unit]
Description=Network Time Service
After=network.target nss-lookup.target

[Service]
Type=forking
PrivateTmp=true
ExecStart=/usr/bin/ntpd -g -u ntp:ntp
ControlGroup=cpu:/

[Install]
WantedBy=multi-user.target

So there's probably something going wrong at the network part.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#3 2012-08-27 16:54:05

D4ve
Member
Registered: 2012-08-02
Posts: 209

Re: [Solved] wlan0 and openntpd

Well, i use openntpd, not ntpd.

Heres the .service from openntpd:

[Unit]
Description=OpenNTP Daemon
After=network.target

[Service]
Type=forking
ExecStart=/usr/sbin/ntpd -s

[Install]
WantedBy=multi-user.target

I think i see the error smile

EDIT: I've added nss-lookup.target to "After=network.target " and it didn't change anything (Of course i rebooted).

What systemctl says:

# systemctl status openntpd
openntpd.service - OpenNTP Daemon
	  Loaded: loaded (/usr/lib/systemd/system/openntpd.service; enabled)
	  Active: active (running) since Mon, 27 Aug 2012 20:56:08 +0200; 7min ago
	  CGroup: name=systemd:/system/openntpd.service
		  ├ 441 /usr/sbin/ntpd -s
		  └ 625 /usr/sbin/ntpd -s

Hm, is it loaded twice?!

Last edited by D4ve (2012-08-27 17:05:26)

Offline

#4 2012-08-27 17:12:27

kevku
Member
From: Estonia
Registered: 2009-11-21
Posts: 73

Re: [Solved] wlan0 and openntpd

is there a reason to use openntpd instead of ntpd?

Last edited by kevku (2012-08-27 17:12:42)

Offline

#5 2012-08-27 17:18:03

D4ve
Member
Registered: 2012-08-02
Posts: 209

Re: [Solved] wlan0 and openntpd

kevku wrote:

is there a reason to use openntpd instead of ntpd?

No.

The wiki says, that openntpd is no longer supported, so i'm switching to ntpd.

Solved smile

Offline

#6 2012-08-27 17:29:12

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [Solved] wlan0 and openntpd

It would be even better to switch to chrony.

Offline

#7 2012-08-27 17:34:04

D4ve
Member
Registered: 2012-08-02
Posts: 209

Re: [Solved] wlan0 and openntpd

I'm not 24/7 online, so it seems to be the better solution. I'll try it out smile

EDIT: With chrony i have the same problems as with openntpd, only ntpd works correct.

Last edited by D4ve (2012-08-27 18:05:48)

Offline

Board footer

Powered by FluxBB