- Remove hardcoded /etc/ntp.conf configuration file from ntpdate rc.d script

and replace it with a new ntpdate_config variable.
- Document it in defaults/rc.conf and rc.conf.5.
- Document ntpdate_hosts in defaults/rc.conf.

Requested by:	Chris Timmons <cwt@networks.cwu.edu>
Approved by:	cperciva (mentor, implicit)
MFC after:	1 week
This commit is contained in:
Florent Thoumie 2006-07-20 10:07:34 +00:00
parent a68654e647
commit ca3a4056ad
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160524
3 changed files with 12 additions and 4 deletions

View File

@ -261,6 +261,8 @@ timed_flags="" # Flags to timed (if enabled).
ntpdate_enable="NO" # Run ntpdate to sync time on boot (or NO).
ntpdate_program="/usr/sbin/ntpdate" # path to ntpdate, if you want a different one.
ntpdate_flags="-b" # Flags to ntpdate (if enabled).
ntpdate_config="/etc/ntp.conf" # ntpdate(8) configuration file
ntpdate_hosts="" # Whitespace-separated list of ntpdate(8) servers.
ntpd_enable="NO" # Run ntpd Network Time Protocol (or NO).
ntpd_program="/usr/sbin/ntpd" # path to ntpd, if you want a different one.
ntpd_config="/etc/ntp.conf" # ntpd(8) configuration file

View File

@ -16,11 +16,11 @@ start_cmd="ntpdate_start"
ntpdate_start()
{
if [ -z "$ntpdate_hosts" -a -f /etc/ntp.conf ]; then
if [ -z "$ntpdate_hosts" -a -f ${ntpdate_config} ]; then
ntpdate_hosts=`awk '
/^server[ \t]*127.127/ {next}
/^(server|peer)/ {print $2}
' </etc/ntp.conf`
' < ${ntpdate_config}`
fi
if [ -n "$ntpdate_hosts" -o -n "$rc_flags" ]; then
echo "Setting date via ntp."

View File

@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd May 29, 2006
.Dd Jul 20, 2006
.Dt RC.CONF 5
.Os
.Sh NAME
@ -1770,11 +1770,17 @@ An option to set this up initially
(from a list of known servers) is also provided by the
.Xr sysinstall 8
program when the system is first installed.
.It Va ntpdate_config
Configuration file for
.Xr ntpdate 8 .
.Pq Vt str
(default
.Pa /etc/ntp.conf ).
.It Va ntpdate_hosts
.Pq Vt str
A whitespace-separated list of NTP servers to synchronize with at startup.
The default is to use the servers listed in
.Pa /etc/ntp.conf ,
.Va ntpdate_config ,
if that file exists.
.It Va ntpdate_program
.Pq Vt str