[Lunar-commits] r22346 - moonbase/trunk/net/openntpd/init.d

Auke Kok sofar at lunar-linux.org
Wed Nov 29 08:22:22 CET 2006


Author: sofar
Date: 2006-11-29 08:22:22 +0100 (Wed, 29 Nov 2006)
New Revision: 22346

Modified:
   moonbase/trunk/net/openntpd/init.d/ntpd
Log:
Add a custom stop command so that the hwclock is synced at shutdown.


Modified: moonbase/trunk/net/openntpd/init.d/ntpd
===================================================================
--- moonbase/trunk/net/openntpd/init.d/ntpd	2006-11-29 05:14:31 UTC (rev 22345)
+++ moonbase/trunk/net/openntpd/init.d/ntpd	2006-11-29 07:22:22 UTC (rev 22346)
@@ -9,5 +9,18 @@
 
 ARGS="-s"
 
+stop()
+{
+	if [ -e /var/run/ntpd.pid ] && [ -e /proc/`cat /var/run/ntpd.pid` ]; then
+		echo -n "Stopping ntpd: "
+		kill `cat /var/run/ntpd.pid` &&
+		rm -f /var/run/ntpd.pid &&
+		hwclock --systohc &&
+		echo -e $RESULT_OK ||
+		echo -e $RESULT_FAIL
+	fi
+
+}
+
 . /lib/lsb/init-functions
 



More information about the Lunar-commits mailing list