Add ntpdate_hosts to rc.conf
John Marshall
John.Marshall at riverwillow.com.au
Tue Sep 27 21:59:45 PDT 2005
Request: Please add "ntpdate_hosts" to /etc/defaults/rc.conf
Context: FreeBSD 5.4-RELEASE-p7 i386
Reasons: - The /etc/rc.d/ntpdate script looks for it
- It's missing from rc.conf
- It's not documented
- Adding the hosts to the existing "ntpdate_flags"
variable
produces unexpected results.
Background:
To the uninitiated, the only apparent "standard" tweaking mechanisms for
any startup script appear to be those included in rc.conf. For ntpdate,
the only tweaks presented in the defaults file are:
- ntpdate_enable
- ntpdate_program
- ntpdate_flags
If the list of hosts is appended to ntpdate_flags (where else would it
go?), then the ntpdate startup script uses them but also appends any
hosts listed as servers in /etc/ntp.conf. The script does this because
it didn't find any hosts via ntpdate_hosts, it doesn't know that you
supplied the hosts via the ntpdate_flags mechanism, it knows that
there's no point running without pointing at any hosts, so it goes and
finds some from ntp.conf. In a scenario where the ntp.conf hosts are not
accessible until after the system startup has finished, this will stall
the startup.
If an empty ntpdate_hosts is added to rc.conf, then people will know
which mechanism to use. An empty ntpdate_hosts list variable will still
result in the ntpdate script looking in ntp.conf, so no harm done there.
A populated ntpdate_hosts list variable keeps the startup script away
from ntp.conf and uses only the listed hosts.
Something like the following in /etc/defaults/rc.conf would make this a
whole lot more intuitive.
ntpdate_hosts="" # (use hosts from /etc/ntp.conf
if blank)
Thank you for listening.
John Marshall
Sydney, NSW, Australia
More information about the freebsd-rc
mailing list