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