ntpd revision 1.7
1#!/bin/sh 2# 3# $NetBSD: ntpd,v 1.7 2002/06/15 01:55:44 lukem Exp $ 4# 5 6# PROVIDE: ntpd 7# REQUIRE: DAEMON 8# BEFORE: LOGIN 9 10. /etc/rc.subr 11 12name="ntpd" 13rcvar=$name 14command="/usr/sbin/${name}" 15pidfile="/var/run/${name}.pid" 16start_precmd="ntpd_precmd" 17required_files="/etc/ntp.conf" 18 19ntpd_precmd() 20{ 21 if [ -z "$ntpd_chrootdir" ]; then 22 return 0; 23 fi 24 25 # If running in a chroot cage, ensure that the appropriate files 26 # exist inside the cage, as well as helper symlinks into the cage 27 # from outside. 28 # 29 # As this is called after the is_running and required_dir checks 30 # are made in run_rc_command(), we can safely assume ${ntpd_chrootdir} 31 # exists and ntpd isn't running at this point (unless forcestart 32 # is used). 33 # 34 # This requires "pseudo-device clockctl" compiled in to kernel. 35 # 36 if [ ! -c "${ntpd_chrootdir}/dev/clockctl" ]; then 37 rm -f "${ntpd_chrootdir}/dev/clockctl" 38 ( cd /dev ; /bin/pax -rw -pe clockctl "${ntpd_chrootdir}/dev" ) 39 fi 40 ln -fs "${ntpd_chrootdir}/var/db/ntp.drift" /var/db/ntp.drift 41 42 # Change run_rc_commands()'s internal copy of $ntpd_flags 43 # 44 rc_flags="-u ntpd:ntpd -i ${ntpd_chrootdir} $rc_flags" 45} 46 47load_rc_config $name 48run_rc_command "$1" 49