[Lunar-commits] r16200 - moonbase/trunk/utils/smartmontools/init.d

Auke Kok sofar at lunar-linux.org
Tue Aug 23 10:41:17 UTC 2005


Author: sofar
Date: 2005-08-23 10:41:14 +0000 (Tue, 23 Aug 2005)
New Revision: 16200

Modified:
   moonbase/trunk/utils/smartmontools/init.d/smartd
Log:
Upgraded this script to work a LOT better; no more fake failed starts.


Modified: moonbase/trunk/utils/smartmontools/init.d/smartd
===================================================================
--- moonbase/trunk/utils/smartmontools/init.d/smartd	2005-08-22 19:07:14 UTC (rev 16199)
+++ moonbase/trunk/utils/smartmontools/init.d/smartd	2005-08-23 10:41:14 UTC (rev 16200)
@@ -1,7 +1,33 @@
 #! /bin/sh
 #
-# chkconfig: 2345 40 40
+# chkconfig: 2345 40 60
 # description: Self Monitoring and Reporting Technology (SMART) Daemon
 # processname: /usr/sbin/smartd 
 #
-. /lib/lsb/init-functions 
+
+start ()
+{
+	echo -n "Starting smartd: "
+	/usr/sbin/smartd &&
+	echo -e $RESULT_OK || echo -e $RESULT_FAIL
+}
+
+stop ()
+{
+	echo -n "Stopping smartd: "
+	/bin/pkill -P 1 smartd &&
+	echo -e $RESULT_OK || echo -e $RESULT_FAIL
+}
+
+status ()
+{
+	echo -n "Service smartd: "
+	if [ -n "$(/bin/pgrep -P 1 smartd)" ] ; then
+		echo -e $RESULT_OK
+	else
+		echo -e $RESULT_FAIL
+	fi
+}
+
+. /lib/lsb/init-functions
+



More information about the Lunar-commits mailing list