Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Feb 2017 15:39:06 -0500
From:      "James B. Byrne" <byrnejb@harte-lyne.ca>
To:        freebsd-questions@freebsd.org
Subject:   FreeBSD 10.3 'service ntpd start' does not create a pid file
Message-ID:  <d87ab8d67b641d7c19f9caddeaad0626.squirrel@webmail.harte-lyne.ca>

next in thread | raw e-mail | index | archive | help
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@SAMBA-01 ~]# cat /var/run/ntpd.pid
69962

[root@SAMBA-01 ~]# echo 70039 > /var/run/ntpd.pid

[root@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@SAMBA-01 ~]# cat /var/run/ntpd.pid
70039

[root@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@SAMBA-01 ~]# cat /var/run/ntpd.pid
70039

[root@SAMBA-01 ~]# service ntpd start
kern.timecounter.hardware: ACPI-fast -> ACPI-fast
kern.timecounter.hardware: ACPI-fast -> ACPI-fast
Starting ntpd.

[root@SAMBA-01 ~]# cat /var/run/ntpd.pid
70039

[root@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@SAMBA-01 ~]# echo 70145 > /var/run/ntpd.pid

[root@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@SAMBA-01 ~]# ll  /var/run/ntpd.pid
-rw-r--r--  1 root  wheel  6 Feb  3 15:30 /var/run/ntpd.pid

[root@SAMBA-01 ~]# rm /var/run/ntpd.pid
remove /var/run/ntpd.pid? y

[root@SAMBA-01 ~]# ll  /var/run/ntpd.pid
ls: /var/run/ntpd.pid: No such file or directory

[root@SAMBA-01 ~]# service ntpd status
kern.timecounter.hardware: ACPI-fast -> ACPI-fast
kern.timecounter.hardware: ACPI-fast -> ACPI-fast
ntpd is not running.

[root@SAMBA-01 ~]# service ntpd start
kern.timecounter.hardware: ACPI-fast -> ACPI-fast
kern.timecounter.hardware: ACPI-fast -> ACPI-fast
Starting ntpd.

[root@SAMBA-01 ~]# ll  /var/run/ntpd.pid
ls: /var/run/ntpd.pid: No such file or directory

[root@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@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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d87ab8d67b641d7c19f9caddeaad0626.squirrel>