home       inleiding       sysadmin       services       links       bash       werk       nothing      

ntp doesn't seem to work

... on a desktop machine lx mint 18.1 i.e. similar to ubuntu 16.04.

  1. what is installed
    $ dpkg -l | grep ntp
    ii  ntp                                           1:4.2.8p4+dfsg-3ubuntu5.3                        amd64        Network Time Protocol daemon and utility programs
    ii  ntpdate                                       1:4.2.8p4+dfsg-3ubuntu5.3                        amd64        client for setting system time from NTP servers
  2. what is running
    $ ps -A | grep ntp

    nothing is running !!!

  3. status of ntp
    $ sudo systemctl status ntp
    ● ntp.service - LSB: Start NTP daemon
    Loaded: loaded (/etc/init.d/ntp; enabled; vendor preset: enabled)
    Active: active (exited) since Fri 2017-03-10 10:53:34 CET; 1 months 18 days ago
     Docs: man:systemd-sysv-generator(8)
     
    Mar 10 10:53:34 lx12 systemd[1]: Starting LSB: Start NTP daemon...
    Mar 10 10:53:34 lx12 ntp[2466]:  * Starting NTP server ntpd
    Mar 10 10:53:34 lx12 ntp[2466]:    ...done.
    Mar 10 10:53:34 lx12 systemd[1]: Started LSB: Start NTP daemon.
    Mar 10 10:53:34 lx12 ntpd[2495]: proto: precision = 0.043 usec (-24)
    Mar 10 10:53:34 lx12 ntpd[2495]: unable to bind to wildcard address :: - another process may be running - EX
    Mar 10 10:56:06 lx12 systemd[1]: Started LSB: Start NTP daemon.
  4. looking up the error on the internet
    ntpd unable to bind to wildcard address 0.0.0.0 - another process may be running
     
    This is because the ntpdate is running when you try to start the server. I haven't found reasons why to leave it installed so you could remove it if you are using ntp daemon:
     
    sudo apt-get remove ntpdate
     
    --Braiam
  5. correcting the problem
    $ sudo apt-get purge ntpdate
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages will be REMOVED:
    ntpdate*
    0 upgraded, 0 newly installed, 1 to remove and 389 not upgraded.
    After this operation, 173 kB disk space will be freed.
    Do you want to continue? [Y/n] y
    (Reading database ... 292817 files and directories currently installed.)
    Removing ntpdate (1:4.2.8p4+dfsg-3ubuntu5.3) ...
    Purging configuration files for ntpdate (1:4.2.8p4+dfsg-3ubuntu5.3) ...
    Processing triggers for man-db (2.7.5-1) ...
     
    $ sudo systemctl stop ntp
     
    $ sudo systemctl start ntp
     
    $ sudo systemctl status ntp
    ● ntp.service - LSB: Start NTP daemon
    Loaded: loaded (/etc/init.d/ntp; enabled; vendor preset: enabled)
    Active: active (running) since Fri 2017-04-28 07:11:26 CEST; 1min 38s left
     Docs: man:systemd-sysv-generator(8)
    Process: 31134 ExecStop=/etc/init.d/ntp stop (code=exited, status=0/SUCCESS)
    Process: 31662 ExecStart=/etc/init.d/ntp start (code=exited, status=0/SUCCESS)
    CGroup: /system.slice/ntp.service
           └─31675 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 108:114
     
    Apr 28 07:11:26 lx12 ntpd[31675]: Listen normally on 4 enp2s0 192.168.5.12:123
    Apr 28 07:11:26 lx12 ntpd[31675]: Listen normally on 5 lo [::1]:123
    Apr 28 07:11:26 lx12 ntpd[31675]: Listen normally on 6 eno1 [fe80::76d4:35ff:fe80:b46c%2]:123
    Apr 28 07:11:26 lx12 ntpd[31675]: Listen normally on 7 enp2s0 [2a02:1811:2c08:a700::12]:123
    Apr 28 07:11:26 lx12 ntpd[31675]: Listen normally on 8 enp2s0 [fe80::6a05:caff:fe3e:9d0%3]:123
    Apr 28 07:11:26 lx12 ntpd[31675]: Listening on routing socket on fd #25 for interface updates
    Apr 28 07:11:27 lx12 ntpd[31675]: Soliciting pool server 85.88.55.5
    Apr 28 07:11:28 lx12 ntpd[31675]: Soliciting pool server 194.78.244.172
    Apr 28 07:09:45 lx12 ntpd[31675]: Soliciting pool server 185.77.199.1
    Apr 28 07:09:46 lx12 ntpd[31675]: Soliciting pool server 193.190.253.212

    notice the time changes on the 2nd-last line ...

    $ date
    Fri Apr 28 07:10:16 CEST 2017