SOURCES: ntpwatchd.init (NEW), ntpwatchd.sysconfig (NEW) - initscript for n...

jajcus jajcus at pld-linux.org
Thu May 15 15:17:38 CEST 2008


Author: jajcus                       Date: Thu May 15 13:17:38 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- initscript for ntpwatchd

---- Files affected:
SOURCES:
   ntpwatchd.init (NONE -> 1.1)  (NEW), ntpwatchd.sysconfig (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/ntpwatchd.init
diff -u /dev/null SOURCES/ntpwatchd.init:1.1
--- /dev/null	Thu May 15 15:17:38 2008
+++ SOURCES/ntpwatchd.init	Thu May 15 15:17:33 2008
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# ntpwatchd	Start and stop CAMK ntp watcher
+# chkconfig:	2345 60 20
+# description:	Watches NTP services
+
+. /etc/rc.d/init.d/functions
+. /etc/sysconfig/ntpwatchd
+
+
+start () {
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/ntpwatchd ]; then
+		msg_starting "ntpwatchd"
+		daemon ntpwatchd.pl "$NTPWATCHD_SERVER"
+		RETVAL=$?
+		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntpwatchd
+	else
+		msg_already_running "ntpwatchd"
+	fi
+}
+
+stop () {
+	if [ -f /var/lock/subsys/ntpwatchd ]; then
+		msg_stopping "ntpwatchd"
+		killproc ntpwatchd
+		rm -f /var/lock/subsys/ntpwatchd /var/run/ntpwatchd.pid >/dev/null 2>&1
+	else
+		msg_not_running ntpwatchd
+	fi
+}
+
+reload () {
+	if [ -f /var/lock/subsys/ntpwatchd ]; then
+		msg_reloading "ntpwatchd"
+		stop
+		start
+	else
+		msg_not_running ntpwatchd
+		exit 7
+	fi
+}
+
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+      	;;
+
+  stop)
+  	stop
+	;;
+  status)
+      	status ntpwatchd
+      	;;
+
+  restart)
+      	stop
+      	start
+      	;;
+
+  reload|force-reload)
+  	reload
+	;;
+
+  *)
+	msg_usage "$0 {start|stop|restart|reload|status}"
+	exit 3
+      	;;
+esac
+
+exit $RETVAL

================================================================
Index: SOURCES/ntpwatchd.sysconfig
diff -u /dev/null SOURCES/ntpwatchd.sysconfig:1.1
--- /dev/null	Thu May 15 15:17:38 2008
+++ SOURCES/ntpwatchd.sysconfig	Thu May 15 15:17:33 2008
@@ -0,0 +1,6 @@
+
+# Define services nice level
+SERVICE_RUN_NICE_LEVEL="+1"
+
+# Time server to use
+NTPWATCHD_SERVER="pool.ntp.org"
================================================================


More information about the pld-cvs-commit mailing list