tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: /etc/rc.d/ntpdate needs named



On Sat, 09 Nov 2013 11:19:42 -0800
"Simon J. Gerraty" <sjg%crufty.net@localhost> wrote:

> After a planned power outage, had to reboot all my computers yesterday
> and noticed that /etc/rc.d/ntpdate couldn't do its thing, since it
> couldn't resolve any of the names in ntp.conf
> 
> Now since the names in ntp.conf like us.pool.ntp.org
> resolve to many addresses which round-robin (good), it is desirable 
> to leave them as names in ntp.conf.
> 
> So I figured I'd make rc.d/ntpdate require 'named'.
> but that doesn't work - rcorder reports a cicular dependency, which I
> was not able to spot.
> 
> After a bit of hack & slash I did get rcorder to list named before
> ntpdate but by then something else (kdc) was complaining.
> 
> In the end I reverted everything and set a bunch of IP's in
> etc/rc.conf:ntpdate_hosts
> though whether any of them will be valid when I next reboot who knows.
> 
> 

As with many services, /etc/rc.d/ntpdate needs named if it's
configuration uses servers that need to be resolved, but strictly speaking,
named is NOT required.

To try and make the startup script smart enough to just "do the right thing" it 
would 
need to determine 

1. is there a server in ntpd.conf that needs to be resolved
2. which named to use. i.e. the one in pkgsrc or the base set.
3. is resolv.conf configured to use a local nameserver

so it's not that it can't be done, just that it's hard to do right. 

An easy workaround for cases like yours would be to 
add /etc/rc.d/named[9] start to /etc/netstart.local. 
I don't like hacking /etc/rc.d/files themselves because it's easy for
local mods to get lost as things get upgraded, etc... 

However, I the above really doesn't matter though most of the time because of 
the following.  

It's fairly common that most users will either start their local nameserver 
hosts, 
and other essential services, before starting regular systems OR use the dns
server of their hosting or service provider. ( perhaps only at the end of the
nameserver list in resolv.conf to provide failover )

I would definately not use an IP address of some ntp.org pool servers. 
Instead, I'd use my local time server, which I started first, OR one
that belonged my hosting provider or ISP. 

Best of luck, 

Harry Waddell 


Home | Main Index | Thread Index | Old Index