NTPD shutsdown shortly after start

For reasons unknown NTPD shutsdown shortly after start. I can’t see anything suspicious in the logs, except ntpd started before dhclient, but it seems to be unrelated.

From /var/log/messages:


Nov 17 11:15:31 localhost ntpd[1374]: ntpd 4.2.6p5@1.2349-o Wed Sep 19 09:31:04 UTC 2012 (1)
Nov 17 11:15:31 localhost ntpd[1377]: proto: precision = 0.977 usec
Nov 17 11:15:31 localhost ntpd[1377]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
Nov 17 11:15:31 localhost ntpd[1377]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Nov 17 11:15:31 localhost ntpd[1377]: Listen and drop on 1 v6wildcard :: UDP 123
Nov 17 11:15:31 localhost ntpd[1377]: Listen normally on 2 lo 127.0.0.1 UDP 123
Nov 17 11:15:31 localhost ntpd[1377]: Listen normally on 3 lo ::1 UDP 123
Nov 17 11:15:31 localhost ntpd[1377]: peers refreshed
Nov 17 11:15:31 localhost ntpd[1377]: Listening on routing socket on fd #20 for interface updates
Nov 17 11:15:31 localhost sntp[1390]: Started sntp
Nov 17 11:15:31 localhost /etc/init.d/ntp: runtime configuration: keyid 1
--
Nov 17 11:15:31 localhost ntp[1047]: 17 Nov 11:15:31 sntp[1354]: Started sntp
Nov 17 11:15:31 localhost ntp[1047]: 17 Nov 11:15:31 sntp[1354]: Error looking up 0.europe.pool.ntp.org: Name or service not known
Nov 17 11:15:31 localhost ntp[1047]: Unable to resolve hostname(s)
Nov 17 11:15:31 localhost ntp[1047]: 17 Nov 11:15:31 sntp[1357]: Started sntp
Nov 17 11:15:31 localhost ntp[1047]: 17 Nov 11:15:31 sntp[1357]: Error looking up 1.europe.pool.ntp.org: Name or service not known
Nov 17 11:15:31 localhost ntp[1047]: Unable to resolve hostname(s)
Nov 17 11:15:31 localhost ntp[1047]: 17 Nov 11:15:31 sntp[1359]: Started sntp
Nov 17 11:15:31 localhost ntp[1047]: 17 Nov 11:15:31 sntp[1359]: Error looking up 2.europe.pool.ntp.org: Name or service not known
Nov 17 11:15:32 localhost ntp[1047]: Unable to resolve hostname(s)
Nov 17 11:15:32 localhost ntp[1047]: 17 Nov 11:15:31 sntp[1361]: Started sntp
Nov 17 11:15:32 localhost ntp[1047]: 17 Nov 11:15:31 sntp[1361]: Error looking up 3.europe.pool.ntp.org: Name or service not known
Nov 17 11:15:32 localhost ntp[1047]: Unable to resolve hostname(s)
Nov 17 11:15:32 localhost ntp[1047]: Time could not be synchronized
Nov 17 11:15:32 localhost ntp[1047]: Starting network time protocol daemon (NTPD)17 Nov 11:15:31 sntp[1390]: Started sntp
Nov 17 11:15:32 localhost ntp[1047]: ..done
--
Nov 17 11:15:32 localhost kernel: r8169 0000:02:00.0: eth0: link up
Nov 17 11:15:32 localhost kernel: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Nov 17 11:15:33 localhost kernel: NET: Registered protocol family 17
Nov 17 11:15:33 localhost dhclient[1794]: Internet Systems Consortium DHCP Client 4.2.4-P2
Nov 17 11:15:33 localhost dhclient[1794]: Copyright 2004-2012 Internet Systems Consortium.
Nov 17 11:15:33 localhost dhclient[1794]: All rights reserved.
Nov 17 11:15:33 localhost dhclient[1794]: For info, please visit https://www.isc.org/software/dhcp/
Nov 17 11:15:33 localhost dhclient[1794]:
Nov 17 11:15:33 localhost dhclient[1794]: Listening on LPF/eth0/40:61:86:2f:7f:55
Nov 17 11:15:33 localhost dhclient[1794]: Sending on   LPF/eth0/40:61:86:2f:7f:55
Nov 17 11:15:33 localhost dhclient[1794]: Sending on   Socket/fallback
Nov 17 11:15:33 localhost dhclient[1794]: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Nov 17 11:15:33 localhost dhclient[1794]: DHCPACK from 192.168.2.1
Nov 17 11:15:33 localhost dhclient[1794]: bound to 192.168.2.64 -- renewal in 794339914 seconds.
--
Nov 17 11:17:47 localhost ntp[3955]: Shutting down network time protocol daemon (NTPD)..done

From /var/log/ntp:


17 Nov 11:15:31 ntpd[1377]: Deferring DNS for 0.europe.pool.ntp.org 1
17 Nov 11:15:31 ntpd[1377]: Deferring DNS for 1.europe.pool.ntp.org 1
17 Nov 11:15:31 ntpd[1377]: Deferring DNS for 2.europe.pool.ntp.org 1
17 Nov 11:15:31 ntpd[1377]: Deferring DNS for 3.europe.pool.ntp.org 1
17 Nov 11:15:33 ntpd[1402]: host name not found: 0.europe.pool.ntp.org
17 Nov 11:15:33 ntpd[1402]: host name not found: 1.europe.pool.ntp.org
17 Nov 11:15:33 ntpd[1402]: host name not found: 2.europe.pool.ntp.org
17 Nov 11:15:33 ntpd[1402]: host name not found: 3.europe.pool.ntp.org
17 Nov 11:15:36 ntpd[1377]: Listen normally on 4 eth0 192.168.2.64 UDP 123
17 Nov 11:15:36 ntpd[1377]: Listen normally on 5 eth0 fe80::4261:86ff:fe2f:7f55 UDP 123
17 Nov 11:15:36 ntpd[1377]: peers refreshed
17 Nov 11:15:36 ntpd[1377]: new interface(s) found: waking up resolver
17 Nov 11:15:38 ntpd[1402]: DNS 0.europe.pool.ntp.org -> 217.169.26.196
17 Nov 11:15:38 ntpd[1402]: DNS 1.europe.pool.ntp.org -> 87.108.20.70
17 Nov 11:15:38 ntpd[1402]: DNS 2.europe.pool.ntp.org -> 178.79.150.93
17 Nov 11:15:38 ntpd[1402]: DNS 3.europe.pool.ntp.org -> 109.74.206.120


openSUSE 12.2

Linux 3.4.11-2.16-desktop #1 SMP PREEMPT Wed Sep 26 17:05:00 UTC 2012 (259fc87) i686 athlon i386 GNU/Linux

Hm, I see no answer until now. Rather new phenimenon I guess :frowning:

What when you start it manualy?

On 2012-11-18 11:06, hcvv wrote:
>
> Hm, I see no answer until now. Rather new phenimenon I guess :frowning:

I read the question, no clue.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

AFAICS it’s because it starts before the network starts.

I’ve started it manually as you suggested and it still runs. Maybe some systemd issue?

There is line in /etc/init.d/ntp, stating that it requires network:

# Required-Start: $network $remote_fs $syslog $named

Still ntp starts before dhclient is started. While according to /var/log/ntp it is eventually able to resolve configured ntp server names before it exits, it sounds better to make it start after dhclient. But how?

Is the networking done through “ifup” or through the Networkmanager?

The networking is done through the Networkmanager.

On 2012-11-19 07:26, D E wrote:
>
> The networking is done through the Networkmanager.

Did you make the connection available to the system?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

If you mean options “Connect automatically” and “System connection” in NM, then yes, both of them checked.

ping topic.

ping topic.

I understand your frustration, but it seems that not many people have the same problem (let alone solved it).
Personaly I do not use NetworkManager and ntpd is running as usual.

On 12/15/2012 06:26 PM, hcvv wrote:
> Personaly I do not use NetworkManager and ntpd is running as usual.

i use NetworkManager and ntpd runs just as i would expect it to…but,
i am on openSUSE 11.4 Evergreen and the version of KDE it was born
with…*

just an idea: if (as you say) it works ok when you manually start it,
why just auto-launch it with a script after the DE is up and running
(and, all the necessary networking stuff is ready to support it)…

sure, it is a nasty kludge, but if that works . . . don’t fix it.

[btw, like Carlos, and others i also read the thread several times and
had nothing to add (no systemd or 12.2 here!) until i (just now) thought
of the kludge]


dd http://tinyurl.com/DD-Caveat
*

On 2012-12-15 18:36, dd wrote:
> On 12/15/2012 06:26 PM, hcvv wrote:
>> Personaly I do not use NetworkManager and ntpd is running as usual.
>
> i use NetworkManager and ntpd runs just as i would expect it to…but,
> i am on openSUSE 11.4 Evergreen and the version of KDE it was born
> with…**

One thing.

I have reread the thread again, lightly not everything. Not sure if this
was said before.

If the network goes off and on, ntpd can quit if it finds the time drift
to large, or if it finds networking impossible, perhaps. If it is
possible for networking to go off, you must ensure that ntpd is stopped,
and then restarted automatically after networking goes on again.

Frankly, I would not use ntpd in that situation. I would instead fire a
one time sync when network goes up.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” (Minas Tirith))

You could check the Startup order for systemd to confirm if ntp should start after Network manager.

systemctl --order

I get:

network.service
NetworkManager.service
nscd.service
ntp.service

If the order is different this could point to an error in your configuration - post back and I’ll ask you to check a few things…

If you’re using a desktop with a cabled ethernet connection then it could be worth switching to traditional networking (YAST - Network Settings - Global Options - “Traditional Method with ifup”) as this appears to work for myself and others.

There is a package systemd-gtk that can be installed via YAST and started either from a terminal prompt or “ALT-F2” using systemadm. This may show you some additional detail on the configuration.