SOURCES: rbldnsd.init - exit codes fix due subshells

glen glen at pld-linux.org
Mon Feb 20 18:55:26 CET 2006


Author: glen                         Date: Mon Feb 20 17:55:26 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- exit codes fix due subshells

---- Files affected:
SOURCES:
   rbldnsd.init (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: SOURCES/rbldnsd.init
diff -u SOURCES/rbldnsd.init:1.3 SOURCES/rbldnsd.init:1.4
--- SOURCES/rbldnsd.init:1.3	Mon Feb 20 18:42:00 2006
+++ SOURCES/rbldnsd.init	Mon Feb 20 18:55:21 2006
@@ -34,6 +34,8 @@
 test -n "$RBLDNSD" || exit 0
 
 forall() {
+	RETVAL=0
+
 	echo "$RBLDNSD" |
 	while read name args; do
 		case "$name" in
@@ -60,11 +62,11 @@
 		fi
 		# call subroutine
 		$1
+		RETVAL=$?
+		[ $? != 0 ] && RETVAL=$?
 	done
-}
 
-report() {
-	echo "$1 $DESC: $name"
+	return $RETVAL
 }
 
 runit() {
@@ -80,6 +82,8 @@
 	else
 		msg_already_running $name
 	fi
+
+	return $RETVAL
 }
 
 stop() {
@@ -92,6 +96,8 @@
 	else
 		msg_not_running $name
 	fi
+
+	return $RETVAL
 }
 
 restart() {
@@ -107,6 +113,8 @@
 	else
 		start
 	fi
+
+	return $RETVAL
 }
 
 reload() {
@@ -116,6 +124,8 @@
 		RETVAL=$?
 		[ "$RETVAL" = 0 ] && ok || fail
 	fi
+
+	return $RETVAL
 }
 
 RETVAL=0
@@ -123,14 +133,17 @@
 case "$1" in
 start|restart)
 	forall $1
-	touch /var/lock/subsys/rbldnsd
+	RETVAL=$?
+	[ "$RETVAL" = 0 ] && touch /var/lock/subsys/rbldnsd
 	;;
 stop)
 	forall $1
-	rm -f /var/lock/subsys/rbldnsd
+	RETVAL=$?
+	[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/rbldnsd
 	;;
 reload|force-reload)
 	forall reload
+	RETVAL=$?
 	;;
 status)
 	status rbldnsd
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/rbldnsd.init?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list