named and ntpd start order in rc.d

Nerius Landys nlandys at
Fri Nov 21 16:47:53 PST 2008

FreeBSD 7.0.  I am having a problem when ntpd starts at bootup.  It
continues to have 2 processes running, the process which does the DNS lookup
fails to exit, and ntpd fails to adjust the clock even after days of
running.  Immediately after bootup and several hours or days later this is
what I get:

# ps -U root | grep ntpd
87837  ??  Ss     0:00.03 /usr/sbin/ntpd -c /etc/ntp.conf -p
87838  ??  S      0:00.00 /usr/sbin/ntpd -c /etc/ntp.conf -p

If I do a "/etc/rc.d/ntpd restart" on a running system it fixes the problem,
and only one of the ntpd processes remains, and the clock gets adjusted.

I have named running as a caching name server on my system.  The contents of
my /etc/resolv.conf:


My /etc/rc.conf:


I believe that the problem with ntpd is that named is started AFTER ntpd.

Trying to reproduce problem.  On a running system. I shut down named.  Then
I restart ntpd, then I start named.  I can reproduce the problem that
happens on bootup - ntpd has 2 processes and does not adjust the clock.
Restarting ntpd while named is running fixes the problem

I believe that the fix for this is to add a dependency to /etc/rc.d/ntpd
script, adding "named" to "REQUIRE" section in comments.  In your opinion,
is this a robust fix?  For example the line in my /etc/rc.d/ntpd script that
looks like so:

# REQUIRE: DAEMON ntpdate cleanvar devfs

would be changed to this:

# REQUIRE: DAEMON ntpdate cleanvar devfs named

Also, should I report this as a bug to some sort of bug tracking system?
Where?  I really like FreeBSD and would like to see all bugs get fixed.
Thanks for a great system to all of you.

 - Nerius

More information about the freebsd-questions mailing list