Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Feb 2017 16:43:56 -0500
From:      Ernie Luzar <luzar722@gmail.com>
To:        byrnejb@harte-lyne.ca
Cc:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 10.3 'service ntpd start' does not create a pid file
Message-ID:  <5894F99C.5090503@gmail.com>
In-Reply-To: <d87ab8d67b641d7c19f9caddeaad0626.squirrel@webmail.harte-lyne.ca>
References:  <d87ab8d67b641d7c19f9caddeaad0626.squirrel@webmail.harte-lyne.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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?
> 


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





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