summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/openntpd/files/openntpd.init.d-20080406-r1')
-rw-r--r--net-misc/openntpd/files/openntpd.init.d-20080406-r141
1 files changed, 41 insertions, 0 deletions
diff --git a/net-misc/openntpd/files/openntpd.init.d-20080406-r1 b/net-misc/openntpd/files/openntpd.init.d-20080406-r1
new file mode 100644
index 000000000000..5a6230d9c61e
--- /dev/null
+++ b/net-misc/openntpd/files/openntpd.init.d-20080406-r1
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openntpd/files/openntpd.init.d-20080406-r1,v 1.1 2013/06/22 14:46:38 ottxor Exp $
+
+name="OpenNTPD"
+command="/usr/sbin/ntpd"
+command_args="${NTPD_OPTS} -d"
+command_background="yes"
+pidfile="/var/run/ntpd.pid"
+logfile="/var/run/ntpd.log"
+start_stop_daemon_args="--stderr ${logfile}"
+
+depend() {
+ need net
+ after ntp-client
+ use dns logger
+}
+
+start_pre() {
+ 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
+
+ checkpath -d -o 0:0 "${NTPD_HOME}"
+
+ # prepare chroot
+ mkdir -p "${NTPD_HOME}/etc"
+ cp /etc/localtime "${NTPD_HOME}/etc"
+
+ return 0
+}