"Failed to start NTP Server Daemon." in journal

I noticed that I am getting this in journalctl (first line in red):


Nov 10 14:41:27 i7 systemd[1]: Failed to start NTP Server Daemon.
Nov 10 14:41:27 i7 start-ntpd[15417]: NTP key id not defined


# rcntpd status
ntpd.service - NTP Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2015-11-10 14:30:27 EET; 6min ago
     Docs: man:ntpd(1)
  Process: 14538 ExecStart=/usr/sbin/start-ntpd start (code=exited, status=5)



What might be causing it and how to fix it?

Hi Joe,
please take a look in /etc/ntp.conf – there should be the following entry in there:


#
# Authentication stuff
#
keys /etc/ntp.keys
# path for keys file
trustedkey 1
# define trusted keys
requestkey 1

Then look in /etc for the NTP files:


# cd /etc/
# l ntp.*
-rw-r----- 1 root ntp 987 20. Aug 10:14 ntp.conf
-rw-r----- 1 root ntp  12 26. Okt 2014  ntp.keys
# file ntp.keys
ntp.keys: ASCII text
# cat ntp.keys
1 M e62d06a
#

Once everything is there and looks OK restart the NTP Daemon (systemctl restart ntpd.service) and then check the systemd status:


# systemctl status ntp-wait.service ntpd.service
ntp-wait.service - Wait for ntpd to synchronize system clock
   Loaded: loaded (/usr/lib/systemd/system/ntp-wait.service; enabled)
   Active: active (exited) since Di 2015-11-10 08:46:15 CET; 5h 51min ago
  Process: 1679 ExecStart=/usr/sbin/ntp-wait -s 0.2 -n 30000 (code=exited, status=0/SUCCESS)
 Main PID: 1679 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/ntp-wait.service


ntpd.service - NTP Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
   Active: active (running) since Di 2015-11-10 08:46:09 CET; 5h 51min ago
     Docs: man:ntpd(1)
  Process: 1428 ExecStart=/usr/sbin/start-ntpd start (code=exited, status=0/SUCCESS)
 Main PID: 1454 (ntpd)
   CGroup: /system.slice/ntpd.service
           └─1454 /usr/sbin/ntpd -p /var/run/ntp/ntpd.pid -g -u ntp:ntp -i /var/lib/ntp -c /etc/ntp.conf

Nov 10 08:46:08 eck001 ntpd[1454]: Listen and drop on 1 v6wildcard :: UDP 123
Nov 10 08:46:08 eck001 ntpd[1454]: Listen normally on 2 lo 127.0.0.1 UDP 123
Nov 10 08:46:08 eck001 ntpd[1454]: Listen normally on 3 enp2s0 192.168.178.23 UDP 123
Nov 10 08:46:08 eck001 ntpd[1454]: Listen normally on 4 lo ::1 UDP 123
Nov 10 08:46:08 eck001 ntpd[1454]: Listen normally on 5 enp2s0 fe80::16da:e9ff:feec:a04d UDP 123
Nov 10 08:46:08 eck001 ntpd[1454]: peers refreshed
Nov 10 08:46:08 eck001 ntpd[1454]: Listening on routing socket on fd #22 for interface updates
Nov 10 08:46:08 eck001 start-ntpd[1428]: Starting network time protocol daemon (NTPD)10 Nov 08:46:08 sntp[1455]:... sntp
Nov 10 08:46:08 eck001 start-ntpd[1428]: 2015-11-10 08:46:08.284866 (-0100) +0.24316 +/- 0.033157 secs
Nov 10 08:46:09 eck001 start-ntpd[1428]: ***Server reports data not found
Hint: Some lines were ellipsized, use -l to show in full.
#

No idea what the “***Server reports data not found” entry is – it began with the last NTP update.
The /var/log/ntp entries are all as follows:

10 Nov 08:55:02 ntpd[1454]: Listen normally on 6 enp2s0 fd00::16da:e9ff:feec:a04d UDP 123
10 Nov 08:55:02 ntpd[1454]: Listen normally on 7 enp2s0 fd00::75a6:b988:b173:dce2 UDP 123
10 Nov 08:55:02 ntpd[1454]: peers refreshed
10 Nov 08:55:02 ntpd[1454]: new interface(s) found: waking up resolver

When everything is OK, NTP Query should report the following Peers status (here mostly from “opensuse.pool.ntp.org”)


# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
-hesinde.lf-net. 235.106.237.243  3 u  341 1024  377   65.540    0.894 128.149
-ms013moonshot.f 5.101.105.6      3 u  345 1024  377   57.165    5.026  87.097
*ntp8.kashra-ser .PPS.            1 u  486 1024  377   95.443   -3.262  67.274
+monitman.com    130.149.17.8     2 u  549 1024  377   69.570    1.069  13.465
+fritz.box       178.63.135.195   3 u   21 1024  377    0.334    0.411   0.463
#

Cheers
DCu

Here is what happened:

  1. ntp.conf and ntp.keys are in place as you explained


# systemctl restart ntpd.service
Job for ntpd.service failed. See "systemctl status ntpd.service" and "journalctl -xn" for details.
# systemctl status ntpd.service
ntpd.service - NTP Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2015-11-10 16:22:27 EET; 15s ago
     Docs: man:ntpd(1)
  Process: 17214 ExecStart=/usr/sbin/start-ntpd start (code=exited, status=5)


# journalctl -xn
-- Logs begin at Sun 2015-10-25 18:21:38 EET, end at Tue 2015-11-10 16:22:27 EET. --
...
Nov 10 16:22:27 i7 start-ntpd[17214]: NTP key id not defined

# ntpq -p
ntpq: read: Connection refused

If ntp is configured to run in chroot (I think it is - or at least was - default), these files probably need to be located in chroot.

I haven’t done anything additional to the default OS installation regarding NTP.

# locate chroot
/etc/postfix/system/update_chroot
/usr/bin/chroot
/usr/share/augeas/lenses/dist/schroot.aug
/usr/share/man/man1/chroot.1.gz
/usr/share/man/man2/chroot.2.gz

Not sure if that gives any info.

Hi Joe,
please check the NTP presence in /var:


:/var # find . -iname '*ntp*'
./adm/netconfig/md5/var/run/ntp
./adm/fillup-templates/sysconfig.ntp
./adm/fillup-templates/sysconfig.syslog-ntp
./log/YaST2/sntp.log
./log/ntp
./run/ntp
./run/ntp/ntpd.pid
find: ‘./run/user/1000/gvfs’: Keine Berechtigung
./run/systemd/generator/ntp.service.d
./db/ntp-kod
./lib/YaST2/ad_ntp_data.ycp
./lib/ntp
./lib/ntp/var/run/ntp
./lib/ntp/var/lib/ntp
./lib/ntp/drift/ntp.drift
./lib/ntp/proc/sys/fs/nfs/nfs_mountpoint_timeout
./lib/ntp/etc/ntp.conf
./lib/ntp/etc/ntp.keys
./lib/systemd/migrated/ntp
./lib/systemd/migrated/ntpd
./lib/systemd/migrated/ntp-wait
./cache/apparmor/usr.sbin.ntpd
:/var #
:/var # l lib/ntp/
insgesamt 24
drwxr-xr-x   7 root root 4096 19. Aug 22:12 ./
drwxr-xr-x  53 root root 4096 10. Okt 00:00 ../
drwxr-xr-x   2 root root 4096 20. Apr 2015  dev/
drwxr-xr-x   2 ntp  ntp  4096 10. Nov 15:46 drift/
drwxr-xr-x   2 root root 4096 12. Okt 10:26 etc/
dr-xr-xr-x 275 root root    0 10. Nov 08:45 proc/
drwxr-xr-x   5 root root 4096 19. Aug 22:12 var/
:/var #

There’s some directories there which need to be owned by the NTP System User.
And, just as a real dumb suggestion, use YaST to initially set-up your NTP configuration – YaST normally performs enough checks to ensure that NTP will run.
Cheers
DCu


# find /var -iname '*ntp*' -exec ls -alF {} \;
-rw-r--r-- 1 root root 1936 Oct 25 15:35 /var/adm/fillup-templates/sysconfig.ntp
-rw-r--r-- 1 root root 430 Oct 25 15:35 /var/adm/fillup-templates/sysconfig.syslog-ntp
total 12
drwxr-xr-x 2 root root 4096 Oct 25 18:41 ./
drwxr-xr-x 3 root root 4096 Oct 25 18:22 ../
-rw-r--r-- 1 root root   42 Oct 25 18:41 servers-netconfig
-rw------- 1 root root 28737 Nov  3 20:13 /var/cache/apparmor/usr.sbin.ntpd
-rw-r--r-- 1 root root 210 Oct 25 18:19 /var/log/YaST2/sntp.log
-rw-r--r-- 1 root root 15273 Nov  3 20:20 /var/log/ntp
-rw-r--r-- 1 root root 0 Oct 25 18:28 /var/db/ntp-kod
total 4
drwxr-xr-x  2 root root  60 Nov 10 16:41 ./
drwxr-xr-x 14 root root 460 Nov 10 16:41 ../
-rw-r--r--  1 root root 110 Nov 10 16:41 50-insserv.conf-$time.conf
-rw-r--r-- 1 root root 0 Oct 26  2014 /var/lib/systemd/migrated/ntp-wait
-rw-r--r-- 1 root root 0 Oct 26  2014 /var/lib/systemd/migrated/ntp
-rw-r--r-- 1 root root 0 Oct 26  2014 /var/lib/systemd/migrated/ntpd
total 24
drwxr-xr-x  6 root root 4096 Oct 25 15:35 ./
drwxr-xr-x 60 root root 4096 Nov 10 16:30 ../
drwxr-xr-x  2 root root 4096 Oct 25 15:35 dev/
drwxr-xr-x  2 ntp  ntp  4096 Oct 25 15:35 drift/
drwxr-xr-x  2 root root 4096 Nov  3 20:20 etc/
drwxr-xr-x  4 root root 4096 Oct 25 15:35 var/
total 8
drwxr-xr-x 2 ntp  root 4096 Nov  3 20:20 ./
drwxr-xr-x 3 root root 4096 Oct 25 15:35 ../
lrwxrwxrwx 1 root root 5 Nov  3 20:20 /var/lib/ntp/var/lib/ntp -> ../../
-rw-r----- 1 root ntp 2964 Oct 25 15:35 /var/lib/ntp/etc/ntp.conf.iburst
-rw-r--r-- 1 ntp ntp 8 Nov  3 20:10 /var/lib/ntp/drift/ntp.drift

I have tried through YaST but even that leads to the same error and YaST cannot restart the service.

Bingo!!
https://bugzilla.novell.com/show_bug.cgi?id=542098
An old issue originally noticed in 2009, with some additions last month (in the year 2015) . . .

So I won! lol!

Does that mean we should simply wait for the next update?

Given that your /etc/ntp.conf has the key entries:


keys /etc/ntp.keys
trustedkey 1
requestkey 1

Then, with Leap 42.1 the following key entry has to be added:

controlkey 1

It may already be at the end of your ntp.conf file as comments:

key (7) for accessing server variables

controlkey 15 # key (6) for accessing server variables

Adding ‘controlkey 1’ helped. Thank you!