From ca3a4056adcc2e14441f046f77a2ce4f8d5396c3 Mon Sep 17 00:00:00 2001 From: Florent Thoumie Date: Thu, 20 Jul 2006 10:07:34 +0000 Subject: [PATCH] - 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 Approved by: cperciva (mentor, implicit) MFC after: 1 week --- etc/defaults/rc.conf | 2 ++ etc/rc.d/ntpdate | 4 ++-- share/man/man5/rc.conf.5 | 10 ++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 02526b3f6e4e..1bd2af7aba4f 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -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 diff --git a/etc/rc.d/ntpdate b/etc/rc.d/ntpdate index 84c473419d17..c76f7a0e7f54 100755 --- a/etc/rc.d/ntpdate +++ b/etc/rc.d/ntpdate @@ -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} - '