SOURCES: acpid.init - use functions to avoid reexec for restart

glen glen at pld-linux.org
Sun Sep 17 18:06:51 CEST 2006


Author: glen                         Date: Sun Sep 17 16:06:51 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions to avoid reexec for restart

---- Files affected:
SOURCES:
   acpid.init (1.19 -> 1.20) 

---- Diffs:

================================================================
Index: SOURCES/acpid.init
diff -u SOURCES/acpid.init:1.19 SOURCES/acpid.init:1.20
--- SOURCES/acpid.init:1.19	Thu Oct 27 11:15:15 2005
+++ SOURCES/acpid.init	Sun Sep 17 18:06:46 2006
@@ -20,11 +20,8 @@
 # Configuration file.
 . /etc/sysconfig/acpid
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
-	# Start daemons.
+# Start daemons.
+start() {
 	if [ ! -f /var/lock/subsys/acpid ]; then
 		if [ ! -d /proc/acpi/button ]; then
 			_modprobe ospm_button
@@ -60,9 +57,10 @@
 	else
 		msg_already_running acpid
 	fi
-	;;
-  stop)
-	# Stop daemons.
+}
+
+# Stop daemons.
+stop() {
 	if [ -f /var/lock/subsys/acpid ]; then
 		msg_stopping acpid
 		killproc acpid
@@ -70,6 +68,20 @@
 	else
 		msg_not_running acpid
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
 	;;
   reload|force-reload)
 	if [ -f /var/lock/subsys/acpid ]; then
@@ -81,14 +93,8 @@
 		exit 7
 	fi
 	;;
-  restart)
-	$0 stop
-	$0 start
-	exit $?
-	;;
   status)
 	status acpid
-	exit $?
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/acpid.init?r1=1.19&r2=1.20&f=u



More information about the pld-cvs-commit mailing list