diff options
Diffstat (limited to 'net-misc/ntp/files/ntpd.rc')
-rw-r--r-- | net-misc/ntp/files/ntpd.rc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/net-misc/ntp/files/ntpd.rc b/net-misc/ntp/files/ntpd.rc new file mode 100644 index 000000000000..b1f5de6ab5d3 --- /dev/null +++ b/net-misc/ntp/files/ntpd.rc @@ -0,0 +1,36 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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" +} |