SOURCES: service_generator.sh - add NO-OP mode

glen glen at pld-linux.org
Mon May 5 15:53:41 CEST 2008


Author: glen                         Date: Mon May  5 13:53:41 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- add NO-OP mode

---- Files affected:
SOURCES:
   service_generator.sh (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SOURCES/service_generator.sh
diff -u SOURCES/service_generator.sh:1.9 SOURCES/service_generator.sh:1.10
--- SOURCES/service_generator.sh:1.9	Mon May  5 15:48:54 2008
+++ SOURCES/service_generator.sh	Mon May  5 15:53:36 2008
@@ -4,6 +4,7 @@
 action="$2"
 desc="$3"
 quiet=$quiet
+noop=$noop
 if [ -z "$desc" ]; then
 	desc="$1 service"
 fi
@@ -19,8 +20,14 @@
 service_body() {
 	cat <<-EOF
 		if [ -f /var/lock/subsys/$service ]; then
-			/sbin/service $service $action 1>&2 || :;
 	EOF
+	if [ "$noop" = 1 ]; then
+		echo :
+	else
+		cat <<-EOF
+				/sbin/service $service $action 1>&2 || :;
+		EOF
+	fi
 
 	if [ "$quiet" != 1 ]; then
 		cat <<-EOF
@@ -69,4 +76,5 @@
 rpm -E '%service monit reload -q "Monit Daemon"' | sh
 rpm -E '%{service monit reload "Monit Daemon"} date' | sh
 rpm -E '%{service monit reload "Monit Daemon" -q} date' | sh
+rpm -E '%{service -n monit restart "Monit Daemon" } date' | sh
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/service_generator.sh?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list