xref: /freebsd/contrib/ntp/scripts/rc/rc.d/ntpd (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1#!/bin/sh
2
3# PROVIDE: ntpd
4# REQUIRE: syslogd cleanvar devfs
5# BEFORE: SERVERS
6
7. /etc/rc.subr
8
9name="ntpd"
10rcvar="ntpd_enable"
11command="/usr/sbin/${name}"
12pidfile="/var/run/${name}.pid"
13start_precmd="ntpd_precmd"
14
15load_rc_config $name
16
17ntpd_precmd()
18{
19        rc_flags="-c ${ntpd_config} ${ntpd_flags}"
20
21        if checkyesno ntpd_sync_on_start; then
22                rc_flags="-g $rc_flags"
23        fi
24
25        if [ -z "$ntpd_chrootdir" ]; then
26                return 0;
27        fi
28
29        rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags"
30}
31
32run_rc_command "$1"
33