FreeBSD 10.3 'service ntpd start' does not create a pid file

Ernie Luzar luzar722 at gmail.com
Fri Feb 3 21:43:18 UTC 2017


James B. Byrne via freebsd-questions wrote:
> Today I have had occasion to stop and restart ntpd on a FreeBSD-10.3
> system multiple times.  I now note that the command 'service ntpd
> start' no longer creates a /var/run/ntpd.pid file or updates an
> existing one.  As a result the 'service ntpd status' command always
> returns that ntpd is stopped.
> 
> [root at SAMBA-01 ~]# cat /var/run/ntpd.pid
> 69962
> 
> [root at SAMBA-01 ~]# echo 70039 > /var/run/ntpd.pid
> 
> [root at SAMBA-01 ~]# service ntpd status
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> ntpd is running as pid 70039.
> 
> [root at SAMBA-01 ~]# cat /var/run/ntpd.pid
> 70039
> 
> [root at SAMBA-01 ~]# service ntpd stop
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> Stopping ntpd.
> Waiting for PIDS: 70039, 70039.
> 
> [root at SAMBA-01 ~]# cat /var/run/ntpd.pid
> 70039
> 
> [root at SAMBA-01 ~]# service ntpd start
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> Starting ntpd.
> 
> [root at SAMBA-01 ~]# cat /var/run/ntpd.pid
> 70039
> 
> [root at SAMBA-01 ~]# ps -auwx | grep sbin/ntpd
> root                        70145   0.0  0.4  32376 18188  -  Is   
> 3:28PM      0:00.05 /usr/sbin/ntpd -g -c /etc/ntp.conf
> 
> If I manually delete the file /var/run/ntpd.pid then the service start
> does not recreate it:
> 
> [root at SAMBA-01 ~]# echo 70145 > /var/run/ntpd.pid
> 
> [root at SAMBA-01 ~]# service ntpd stop
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> Stopping ntpd.
> Waiting for PIDS: 70145, 70145.
> 
> [root at SAMBA-01 ~]# ll  /var/run/ntpd.pid
> -rw-r--r--  1 root  wheel  6 Feb  3 15:30 /var/run/ntpd.pid
> 
> [root at SAMBA-01 ~]# rm /var/run/ntpd.pid
> remove /var/run/ntpd.pid? y
> 
> [root at SAMBA-01 ~]# ll  /var/run/ntpd.pid
> ls: /var/run/ntpd.pid: No such file or directory
> 
> [root at SAMBA-01 ~]# service ntpd status
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> ntpd is not running.
> 
> [root at SAMBA-01 ~]# service ntpd start
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> kern.timecounter.hardware: ACPI-fast -> ACPI-fast
> Starting ntpd.
> 
> [root at SAMBA-01 ~]# ll  /var/run/ntpd.pid
> ls: /var/run/ntpd.pid: No such file or directory
> 
> [root at SAMBA-01 ~]# ps -auwx | grep ntpd
> root                        70217   0.0  0.4  32376 18188  -  Is   
> 3:31PM      0:00.06 /usr/sbin/ntpd -g -c /etc/ntp.conf
> root                        70238   0.0  0.1  18832  2340  1  S+   
> 3:34PM      0:00.00 grep --color ntpd
> 
> 
> Can anyone tell me why this is happening?
> 


ntpd had some security updates before the end of the year.
Run freebsd-update to get 10.3 updated with ntpd fixs.




More information about the freebsd-questions mailing list