diff options
author | flz <flz@FreeBSD.org> | 2006-04-18 15:02:24 +0000 |
---|---|---|
committer | flz <flz@FreeBSD.org> | 2006-04-18 15:02:24 +0000 |
commit | b1851f7c4d39d33116757d6ee3482e2a1ba55cb1 (patch) | |
tree | 0d1bc15a8e2344f012bdf73960a3ace6f93aef91 /etc | |
parent | 7a0948ca69080690b83bccd7022c331c49589ab8 (diff) | |
download | FreeBSD-src-b1851f7c4d39d33116757d6ee3482e2a1ba55cb1.zip FreeBSD-src-b1851f7c4d39d33116757d6ee3482e2a1ba55cb1.tar.gz |
- Add new ntpd_config variable so that people can override it in rc.conf.
- Add default value in /etc/defaults/rc.conf.
- Add documentation bits to rc.conf(5).
Approved by: cperciva (mentor)
MFC after: 1 week
Diffstat (limited to 'etc')
-rw-r--r-- | etc/defaults/rc.conf | 1 | ||||
-rwxr-xr-x | etc/rc.d/ntpd | 10 |
2 files changed, 8 insertions, 3 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index f82addf..316705e 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -260,6 +260,7 @@ ntpdate_program="/usr/sbin/ntpdate" # path to ntpdate, if you want a different o ntpdate_flags="-b" # Flags to ntpdate (if enabled). 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 ntpd_sync_on_start="NO" # Sync time on ntpd startup, even if offset is high ntpd_flags="-p /var/run/ntpd.pid -f /var/db/ntpd.drift" # Flags to ntpd (if enabled). diff --git a/etc/rc.d/ntpd b/etc/rc.d/ntpd index 5cc7aac..ba01b43 100755 --- a/etc/rc.d/ntpd +++ b/etc/rc.d/ntpd @@ -15,12 +15,17 @@ rcvar=`set_rcvar` command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" start_precmd="ntpd_precmd" -required_files="/etc/ntp.conf" + +load_rc_config $name + +required_files="${ntpd_config}" ntpd_precmd() { + rc_flags="-c ${ntpd_config} ${ntpd_flags}" + if checkyesno ntpd_sync_on_start; then - rc_flags="-g ${ntpd_flags}" + rc_flags="-g $rc_flags" fi if [ -z "$ntpd_chrootdir" ]; then @@ -47,5 +52,4 @@ ntpd_precmd() rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags" } -load_rc_config $name run_rc_command "$1" |