Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Dec 2008 18:26:50 -0500
From:      Greg Larkin <glarkin@FreeBSD.org>
To:        Nerius Landys <nlandys@gmail.com>
Cc:        questions@freebsd.org
Subject:   Re: named and ntpd start order in rc.d
Message-ID:  <493715BA.8050000@FreeBSD.org>
In-Reply-To: <560f92640812031301m5f51d2c7ia3bcf44454a47820@mail.gmail.com>
References:  <560f92640811211647q551daccnaec4e8085bb8e042@mail.gmail.com> <560f92640812031301m5f51d2c7ia3bcf44454a47820@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nerius Landys wrote:
>> 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
>> /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.
>>
>> 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
>>
>> 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
> 
> Modifying /etc/rc.d/ntpd in this manner did not fix the problem.  I
> still have 2 ntpd processes running indefinitely after bootup of the
> system, until I manually issue a "/etc/rc.d/ntpd restart", after which
> the ntpd runs fine.  As a separate test, I tried adjusting my
> resolv.conf to point to an external name server, and I disabled named
> at startup, and used the original /etc/rc.d/ntpd.  I still got the
> same problem - 2 ntpd processes running indefinitely.
> 
> Does anyone know why I'm getting 2 ntpd processes running after bootup
> (and ntpd fails to adjust the clock as a result)?  Any suggested fix
> would be appreciated.

Hi Nerius,

I don't know why those processes are hung after boot, but in order to
troubleshoot the problem, I suggest that you modify the /etc/rc.d/ntpd
script to invoke ntpd from truss and log the output to a file, e.g.
/tmp/truss.log.$$.  Once you've rebooted, kill the processes and post
the the log files on a web site somewhere so we can have a look at them.

Also, what are the contents of your /etc/ntp.conf file?

Best regards,
Greg
- --
Greg Larkin

http://www.FreeBSD.org/       - The Power To Serve
http://www.sourcehosting.net/ - Ready. Set. Code.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJNxW60sRouByUApARApi2AKC+p8UxGYtbdnF/SDGxB4yGV8mpOgCfTi8s
yeb2mXFtkWw4OoDxrPWtkho=
=O9RE
-----END PGP SIGNATURE-----




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