summaryrefslogtreecommitdiffstats
path: root/main/openntpd/openntpd.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-10-20 12:45:58 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-10-20 12:48:07 +0000
commit34cf1842fe9ecfa0091bc37d885311a8ad2fcd4b (patch)
tree05f35f37455438574dc1069f2acea0a5858c0189 /main/openntpd/openntpd.initd
parent613424a75b231bd98a499241d5d7cbee099843ed (diff)
downloadaports-34cf1842fe9ecfa0091bc37d885311a8ad2fcd4b.tar.bz2
aports-34cf1842fe9ecfa0091bc37d885311a8ad2fcd4b.tar.xz
main/openntpd: use /etc for config
Diffstat (limited to 'main/openntpd/openntpd.initd')
-rw-r--r--main/openntpd/openntpd.initd41
1 files changed, 41 insertions, 0 deletions
diff --git a/main/openntpd/openntpd.initd b/main/openntpd/openntpd.initd
new file mode 100644
index 000000000..81648dc03
--- /dev/null
+++ b/main/openntpd/openntpd.initd
@@ -0,0 +1,41 @@
+#!/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/openntpd/files/openntpd.rc,v 1.7 2008/10/10 09:40:10 bangert Exp $
+
+depend() {
+ need net
+ after ntp-client
+ use dns logger
+}
+
+checkconfig() {
+ if [ ! -f /etc/ntpd.conf ] ; then
+ eerror "Could not find /etc/ntpd.conf!"
+ return 1
+ fi
+
+ if [ -x /usr/bin/getent ] ; then
+ if [ "`getent passwd ntp | cut -d: -f 6`" != "${NTPD_HOME}" ] ; then
+ eerror "Home directory of ntp needs to be ${NTPD_HOME}"
+ eerror "Please run 'usermod -d ${NTPD_HOME} ntp'"
+ return 1
+ fi
+ fi
+
+ return 0
+}
+
+start() {
+ checkconfig || return $?
+
+ ebegin "Starting ntpd"
+ start-stop-daemon --start --exec /usr/sbin/ntpd --name ntpd -- ${NTPD_OPTS}
+ eend $? "Failed to start ntpd"
+}
+
+stop() {
+ ebegin "Stopping ntpd"
+ start-stop-daemon --stop --exec /usr/sbin/ntpd --name ntpd --user root
+ eend $? "Failed to stop openntpd"
+}