Page 1 of 1

ntpd doesn't run

Posted: Fri Dec 14, 2018 2:04 pm
by dld
I run Mint 18 Mate on three machines. A week or so ago I realized that the machine I use most often did not have correct time. ntpq -pn revealed that the ntp.conf file had been read but there apparently has been no communication with servers, pool or the local servers I have since added to ntp.conf.

Code: Select all

dld ~ $ ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 128.104.30.17   .XFAC.          16 u    -  128    0    0.000    0.000   0.000
 144.92.20.100   .XFAC.          16 u  69m  128    0    0.000    0.000   0.000
 144.92.104.20   .XFAC.          16 u  97m  128    0    0.000    0.000   0.000
 0.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 1.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 2.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 3.ubuntu.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.000
 ntp.ubuntu.com  .POOL.          16 p    -   64    0    0.000    0.000   0.000
My two other machines seem to be running ntp fine. What am I missing?

Re: ntpd doesn't run

Posted: Fri Dec 14, 2018 4:49 pm
by ajgringo619
Good question. Can you manually update the time?

Code: Select all

sudo ntpdate -u 0.ubuntu.pool.ntp.org
Is your /etc/ntp.conf the same as the other machines?
What does sudo systemctl status ntp show?

Re: ntpd doesn't run

Posted: Fri Dec 14, 2018 5:21 pm
by ajgringo619
I just noticed that my system has timesyncd and ntpd running at the same time. I disabled ntpd.
Could you post the results of the following?

Code: Select all

systemctl status systemd-timesyncd
journalctl --no-pager | grep timesyncd
journalctl --no-pager | grep ntpdate

Re: ntpd doesn't run

Posted: Wed Dec 19, 2018 12:03 pm
by dld
Here are responses to suggested experiments. I don't know what to make of them.

dld@DLD7 ~ $ sudo ntpdate -u 0.ubuntu.pool.ntp.org
[sudo] password for dld:
19 Dec 09:54:01 ntpdate[3344]: step time server 45.76.244.202 offset 49.827164 sec
dld@DLD7 ~ $ sudo systemctl status ntp
● ntp.service - LSB: Start NTP daemon
Loaded: loaded (/etc/init.d/ntp; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-12-19 09:15:39 CST; 39min ago
Docs: man:systemd-sysv-generator(8)
Process: 873 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/ntp.service
└─945 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 108:114

Dec 19 09:52:53 DLD7 ntpd[945]: Soliciting pool server 64.142.122.38
Dec 19 09:52:54 DLD7 ntpd[945]: Soliciting pool server 45.79.111.114
Dec 19 09:52:59 DLD7 ntpd[945]: Soliciting pool server 96.8.121.205
Dec 19 09:53:00 DLD7 ntpd[945]: Soliciting pool server 154.16.245.246
Dec 19 09:53:02 DLD7 ntpd[945]: Soliciting pool server 91.189.94.4
Dec 19 09:54:48 DLD7 ntpd[945]: Soliciting pool server 45.76.244.202
Dec 19 09:54:50 DLD7 ntpd[945]: Soliciting pool server 66.135.44.92
Dec 19 09:54:54 DLD7 ntpd[945]: Soliciting pool server 108.61.56.35
Dec 19 09:54:54 DLD7 ntpd[945]: Soliciting pool server 103.105.51.156
Dec 19 09:54:57 DLD7 ntpd[945]: Soliciting pool server 2001:67c:1560:8003::c8
dld@DLD7 ~ $ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendo
Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
└─disable-with-time-daemon.conf
Active: inactive (dead)
Condition: start condition failed at Wed 2018-12-19 09:15:39 CST; 41min ago
ConditionFileIsExecutable=!/usr/sbin/ntpd was not met
Docs: man:systemd-timesyncd.service(8)
...skipping...
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendo
Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
└─disable-with-time-daemon.conf
Active: inactive (dead)
Condition: start condition failed at Wed 2018-12-19 09:15:39 CST; 41min ago
ConditionFileIsExecutable=!/usr/sbin/ntpd was not met
Docs: man:systemd-timesyncd.service(8)
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
...skipping...
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendo
Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
└─disable-with-time-daemon.conf
Active: inactive (dead)
Condition: start condition failed at Wed 2018-12-19 09:15:39 CST; 41min ago
ConditionFileIsExecutable=!/usr/sbin/ntpd was not met
Docs: man:systemd-timesyncd.service(8)
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
...skipping...
● systemd-timesyncd.service - Network Time Synchronization
Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendo
Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
└─disable-with-time-daemon.conf
Active: inactive (dead)
Condition: start condition failed at Wed 2018-12-19 09:15:39 CST; 41min ago
ConditionFileIsExecutable=!/usr/sbin/ntpd was not met
Docs: man:systemd-timesyncd.service(8)
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
dld@DLD7 ~ $

Re: ntpd doesn't run

Posted: Wed Dec 19, 2018 2:23 pm
by ajgringo619
You're definitely having a conflict between the (2) time services. I would disable ntpd and try to restart systemd-timesyncd; you shouldn't need a reboot. After you do this, check the services to make sure they're working (your output should be something similar):

Code: Select all

$ systemctl status ntp
● ntp.service - Network Time Service
   Loaded: loaded (/lib/systemd/system/ntp.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:ntpd(8)

Code: Select all

$ systemctl status systemd-timesyncd
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2018-12-18 08:28:16 PST; 1 day 1h ago
     Docs: man:systemd-timesyncd.service(8)
 Main PID: 860 (systemd-timesyn)
   Status: "Synchronized to time server [2001:67c:1560:8003::c8]:123 (ntp.ubuntu.com)."
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/systemd-timesyncd.service
           └─860 /lib/systemd/systemd-timesyncd

Code: Select all

$ timedatectl status
                      Local time: Wed 2018-12-19 10:20:32 PST
                  Universal time: Wed 2018-12-19 18:20:32 UTC
                        RTC time: Wed 2018-12-19 18:20:31
                       Time zone: America/Los_Angeles (PST, -0800)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no