Calling /etc/rc.d/ntpd stop issue an error "ntpd not running? (check /var/run/ntpd.pid)." but ntpd is active!
# /etc/rc.d/ntpd start
# ps auxww | grep ntpd
root 2577 0.5 0.1 22196 4052 ?? Ss 10:37PM 0:00.04 /usr/sbin/ntpd -c /etc/ntp.conf -L
# cat /var/run/ntpd.pid
cat: /var/run/ntpd.pid: No such file or directory
# /etc/rc.d/ntpd stop
ntpd not running? (check /var/run/ntpd.pid).
But ntpd is actually running:
# ps auxww | grep ntpd
root 2577 0.0 0.1 22196 4064 ?? Ss 10:37PM 0:00.06 /usr/sbin/ntpd -c /etc/ntp.conf -L
How-To-Repeat: Enable ntpd in your /etc/rc.conf file with
echo "ntpd_enable='YES'" >> /etc/rc.conf
Start ntpd with
Than stop it with
You get the error "ntpd not running? (check /var/run/ntpd.pid)."
ps auxww | grep ntpd
to check that NTPD is actually running.
Over to maintainer(s).
[fowarded message - forgot to add bug-followup@ to the Cc: list]
Date: Mon, 25 Mar 2013 12:27:41 +1100
From: John Marshall <email@example.com>
To: Maurizio Giunti <firstname.lastname@example.org>
Cc: freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org
Subject: Re: conf/177089: ntpd startup script does not work well
User-Agent: Mutt/1.5.21 (2010-09-15)
> Calling /etc/rc.d/ntpd stop issue an error "ntpd not running? (check /var/run/ntpd.pid)." but ntpd is active!
Please check to see if you have set ntpd_flags in your /etc/rc.conf.
Note the default contents of this variable in /etc/defaults/rc.conf
ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift"
If you define ntpd_flags in your /etc/rc.conf, you override the default
ntpd_flags. In order to retain the expected behaviour of the rc script,
you need to include the default ntpd_flags in your modified variable.
So, if you want to pass other flags to ntpd, then you would put this in
ntpd_flags="<other flags> -p /var/run/ntpd.pid -f /var/db/ntpd.drift"
Please let us know if this solves your problem so that the PR can be
On Mon, 25 Mar 2013, 18:12 +0100, Maurizio Giunti wrote:
> you are absolutely right!
> I added the flags you suggested and now ntpd starts and stops as expected.
> Thank you!
Good. I suggest that this PR may now be closed.
> Just in case, I still can't get -L flag work, exactly as described here:
> Have you any idea about it? :)
I chased this years ago and discovered that the ntpd '-L' option only
ever worked on Linux (but I can't locate an authoritative reference
right now). This section of the ntpd code has been reworked in recent
years and current versions use a configuration file 'interface'
directive instead, which works on FreeBSD. In order to select specific
ntpd service addresses you will need to upgrade to a current version of
ntpd (e.g. via ports net/ntp) and use the 'interface listen' directive
For bugs matching the following criteria:
Status: In Progress Changed: (is less than) 2014-06-01
Reset to default assignee and clear in-progress tags.
Mail being skipped
*** This bug has been marked as a duplicate of bug 199127 ***