You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-misc/ntp/files/ntpd.rc

37 lines
819 B

#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/ntp/files/ntpd.rc,v 1.24 2010/07/18 21:53:24 vapier Exp $
depend() {
use net dns logger
after ntp-client
}
checkconfig() {
if [ ! -f /etc/ntp.conf ] ; then
eerror "Please create /etc/ntp.conf"
eerror "Sample conf: /usr/share/ntp/ntp.conf"
return 1
fi
return 0
}
start() {
checkconfig || return $?
ebegin "Starting ntpd"
start-stop-daemon --start --exec /usr/sbin/ntpd \
--pidfile /var/run/ntpd.pid \
-- -p /var/run/ntpd.pid ${NTPD_OPTS}
eend $? "Failed to start ntpd"
}
stop() {
ebegin "Stopping ntpd"
start-stop-daemon --stop \
--pidfile /var/run/ntpd.pid \
--exec /usr/sbin/ntpd
eend $? "Failed to stop ntpd"
}