FreeBSD 10.3 'service ntpd start' does not create a pid file
James B. Byrne
byrnejb at harte-lyne.ca
Fri Feb 3 20:39:17 UTC 2017
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?
--
*** e-Mail is NOT a SECURE channel ***
Do NOT transmit sensitive data via e-Mail
Do NOT open attachments nor follow links sent by e-Mail
James B. Byrne mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3
More information about the freebsd-questions
mailing list