Skip to content

ntp: ntpdate.service breaks ntpd #386

@azaharia-wr

Description

@azaharia-wr

When using ntpdate.service for big time jumps, the ntpd.service fails to start.

ntpdate-sync script executes the ntpdate binary in background which makes the ntpdate.service unit file exit before the ntpdate finishes execution.

root@intel-x86-64:~# systemctl status ntpdate.service
● ntpdate.service - Network Time Service (one-shot ntpdate mode)
   Loaded: loaded (/lib/systemd/system/ntpdate.service; enabled; vendor preset: enabled)
   Active: active (exited) since Mon 2021-06-28 08:42:05 UTC; 5min ago
  Process: 182 ExecStart=/usr/bin/ntpdate-sync silent (code=exited, status=0/SUCCESS)
 Main PID: 182 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4728)
   Memory: 1.8M
   CGroup: /system.slice/ntpdate.service

Jun 28 08:42:05 intel-x86-64 systemd[1]: Starting Network Time Service (one-shot ntpdate mode)...
Jun 28 08:42:05 intel-x86-64 systemd[1]: Started Network Time Service (one-shot ntpdate mode).
Jun 28 08:45:46 intel-x86-64 ntpdate[188]: step time server 128.224.126.11 offset 215.092716 sec
root@intel-x86-64:~# systemctl status ntpd.service
● ntpd.service - Network Time Service
   Loaded: loaded (/lib/systemd/system/ntpd.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2021-06-28 08:42:05 UTC; 5min ago
  Process: 233 ExecStart=/usr/sbin/ntpd -u ntp:ntp -p /run/ntpd.pid -g (code=exited, status=0/SUCCESS)
 Main PID: 253 (code=exited, status=1/FAILURE)

Jun 28 08:42:05 intel-x86-64 systemd[1]: Starting Network Time Service...
Jun 28 08:42:05 intel-x86-64 systemd[1]: ntpd.service: Can't open PID file /run/ntpd.pid (yet?) after start: No such file or directory
Jun 28 08:42:05 intel-x86-64 ntpd[253]: proto: precision = 0.044 usec (-24)
Jun 28 08:42:05 intel-x86-64 ntpd[253]: basedate set to 2021-05-13
Jun 28 08:42:05 intel-x86-64 ntpd[253]: gps base set to 2021-05-16 (week 2158)
Jun 28 08:42:05 intel-x86-64 systemd[1]: Started Network Time Service.
Jun 28 08:42:05 intel-x86-64 ntpd[253]: unable to bind to wildcard address :: - another process may be running - EXITING
Jun 28 08:42:05 intel-x86-64 systemd[1]: ntpd.service: Main process exited, code=exited, status=1/FAILURE
Jun 28 08:42:05 intel-x86-64 systemd[1]: ntpd.service: Failed with result 'exit-code'.
root@intel-x86-64:~#   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions