SOURCES: htpdate.init (NEW), htpdate.sysconfig (NEW) - new (by Mac...

adamg adamg at pld-linux.org
Tue Dec 27 18:43:13 CET 2005


Author: adamg                        Date: Tue Dec 27 17:43:13 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- new (by Maciej Witaszek)

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

---- Diffs:

================================================================
Index: SOURCES/htpdate.init
diff -u /dev/null SOURCES/htpdate.init:1.1
--- /dev/null	Tue Dec 27 18:43:13 2005
+++ SOURCES/htpdate.init	Tue Dec 27 18:43:08 2005
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# htpdate		This shell script synchronizes time with htpdate (HTP client)
+#
+# chkconfig:	2345 55 10
+# description:	htpdate is the HTP client.
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source networking configuration.
+. /etc/sysconfig/network
+
+# Source ntp configuration
+. /etc/sysconfig/htpdate
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down htpdate
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+[ -x /usr/sbin/htpdate ] || exit 0
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+cronsettime)
+	is_yes "$HTPDATE_CRON" && /usr/sbin/htpdate -l $HTPDATE_OPTIONS $HTPDATE_SERVERS > /dev/null 2>&1
+	RETVAL=$?
+	;;
+start)
+	show "Syncing time with htpdate (backgrounding)"
+	daemon --fork /usr/sbin/htpdate -l $HTPDATE_OPTIONS $HTPDATE_SERVERS
+	RETVAL=$?
+	;;
+stop)
+	exit $RETVAL
+	;;
+restart|force-reload)
+	$0 start
+	exit $?
+	;;
+*)
+	msg_usage "$0 {start|restart|force-reload}"
+	exit 3
+esac
+
+exit $RETVAL

================================================================
Index: SOURCES/htpdate.sysconfig
diff -u /dev/null SOURCES/htpdate.sysconfig:1.1
--- /dev/null	Tue Dec 27 18:43:13 2005
+++ SOURCES/htpdate.sysconfig	Tue Dec 27 18:43:08 2005
@@ -0,0 +1,6 @@
+# Sync time at startup
+HTPDATE_OPTIONS="-s"
+HTPDATE_SERVERS="www.aster.pl"
+
+# also run htpdate from cron
+HTPDATE_CRON="yes"
================================================================


More information about the pld-cvs-commit mailing list