Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Nov 2008 19:53:09 GMT
From:      Nerius Landys <nlandys@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/129146: named and ntpd start order in rc.d
Message-ID:  <200811241953.mAOJr9qj002373@www.freebsd.org>
Resent-Message-ID: <200811242000.mAOK0JV3032167@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         129146
>Category:       conf
>Synopsis:       named and ntpd start order in rc.d
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 24 20:00:19 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Nerius Landys
>Release:        7.0-RELEASE
>Organization:
(hobby)
>Environment:
FreeBSD daffy.nerius.com 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Fri Feb 29 18:56:41 PST 2008     root@daffy.nerius.com:/usr/obj/usr/src/sys/DAFFY  i386
>Description:
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 (I believe), 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 /var/run/ntpd.pid
87838  ??  S      0:00.00 /usr/sbin/ntpd -c /etc/ntp.conf -p /var/run/ntpd.pid

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.
>How-To-Repeat:
I have named running as a caching name server on my system.  The contents of my /etc/resolv.conf:

domain  nerius.com
nameserver      127.0.0.1

My /etc/rc.conf:

..
named_enable="YES"
ntpd_enable="YES"
..

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.
>Fix:
I don't have a 100% fix for this problem, and I am unable to test my suggested fix below because it's too dangerous to do on my running server.  An expert will know the elegant fix to this problem; below is only a guess/suggestion.

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

>Release-Note:
>Audit-Trail:
>Unformatted:



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