[packages/incron] - unify initscript

glen glen at pld-linux.org
Sun Oct 21 14:38:41 CEST 2012


commit ffa530e73b24cfd32f5a3301cb00e556d075c7e4
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Oct 21 15:38:24 2012 +0300

    - unify initscript

 incron.init | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/incron.init b/incron.init
index 029333b..3f1c6d8 100755
--- a/incron.init
+++ b/incron.init
@@ -19,35 +19,37 @@
 
 start() {
 	# Check if the service is already running?
-	if [ ! -f /var/lock/subsys/incrond ]; then
-		msg_starting incrond
-		daemon /usr/sbin/incrond
-		RETVAL=$?
-		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/incrond
-	else
+	if [ -f /var/lock/subsys/incrond ]; then
 		msg_already_running incrond
+		return
 	fi
+
+	msg_starting incrond
+	daemon /usr/sbin/incrond
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/incrond
 }
 
 stop() {
 	# Stop daemons.
-	if [ -f /var/lock/subsys/incrond ]; then
-		msg_stopping incrond
-		killproc incrond
-		rm -f /var/lock/subsys/incrond >/dev/null 2>&1
-	else
+	if [ ! -f /var/lock/subsys/incrond ]; then
 		msg_not_running incrond
 	fi
+
+	msg_stopping incrond
+	killproc incrond
+	rm -f /var/lock/subsys/incrond >/dev/null 2>&1
 }
 
 condrestart() {
-	if [ -f /var/lock/subsys/incrond ]; then
-		stop
-		start
-	else
+	if [ ! -f /var/lock/subsys/incrond ]; then
 		msg_not_running incrond
 		RETVAL=$1
+		return
 	fi
+
+	stop
+	start
 }
 
 RETVAL=0
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/incron.git/commitdiff/ffa530e73b24cfd32f5a3301cb00e556d075c7e4



More information about the pld-cvs-commit mailing list