extras-buildsys/etc plague-builder.config, 1.3, 1.4 plague-builder.init, 1.4, 1.5

Daniel Williams (dcbw) fedora-extras-commits at redhat.com
Thu Jul 14 21:13:27 UTC 2005


Author: dcbw

Update of /cvs/fedora/extras-buildsys/etc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19016/etc

Modified Files:
	plague-builder.init 
Added Files:
	plague-builder.config 
Log Message:
2005-07-14  Dan Williams <dcbw at redhat.com>

    * etc/plague-builder.init
      etc/plague-builder.config
        - Allow multiple builders to be started/stopped at one time.
            plague-builder.config must be copied to /etc/sysconfig/plague-builder
            and have the CONFIGS variable defined to be a space-separated
            list of builder config files, with the whole list enclosed in quotes




Index: plague-builder.config
===================================================================
RCS file: plague-builder.config
diff -N plague-builder.config
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ plague-builder.config	14 Jul 2005 21:13:25 -0000	1.4
@@ -0,0 +1 @@
+CONFIGS="/etc/plague/builder/CONFIG.py"


Index: plague-builder.init
===================================================================
RCS file: /cvs/fedora/extras-buildsys/etc/plague-builder.init,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- plague-builder.init	13 Jul 2005 19:36:12 -0000	1.4
+++ plague-builder.init	14 Jul 2005 21:13:25 -0000	1.5
@@ -13,19 +13,56 @@
 # Source function library.
 . /etc/init.d/functions
 
+. /etc/sysconfig/plague-builder
+
+
+start_one() {
+    PORT=$1
+    echo -n "Starting plague-builder on port $PORT: "
+    daemon plague-builder -d -p /var/run/plague-builder-$PORT.pid -l /var/log/plague-builder-$PORT.log -c $config
+    echo
+    touch /var/lock/subsys/plague-builder-$PORT
+    return 0
+}
+
 start() {
-	echo -n "Starting plague-builder: "
-	daemon plague-builder -d -p /var/run/plague-builder.pid -l /var/log/plague-builder.log -c /etc/plague/builder/CONFIG.py
-	echo
-	touch /var/lock/subsys/plague-builder
-	return 0
+    for config in $CONFIGS; do
+        # Get the builder's XMLRPC port #, which should be unique
+        PORT=`python -c "execfile('$config'); print config_opts['xmlrpc_port']"`
+        start_one $PORT
+    done
+    return 0
 }	
 
+stop_one() {
+    PORT=$1
+    echo -n "Shutting down plague-builder on port $PORT: "
+    killproc plague-builder-$PORT
+    echo
+    rm -f /var/lock/subsys/plague-builder-$PORT
+    return 0
+}
+
 stop() {
-	echo -n "Shutting down plague-builder: "
-	killproc plague-builder
-	echo
-	rm -f /var/lock/subsys/plague-builder
+    for config in $CONFIGS; do
+        # Get the builder's XMLRPC port #, which should be unique
+        PORT=`python -c "execfile('$config'); print config_opts['xmlrpc_port']"`
+        stop_one $PORT
+    done
+    return 0
+}
+
+condrestart() {
+	[ -f /var/lock/subsys/plague-builder ] && restart || :
+
+    for config in $CONFIGS; do
+        # Get the builder's XMLRPC port #, which should be unique
+        PORT=`python -c "execfile('$config'); print config_opts['xmlrpc_port']"`
+    	if [ -f /var/lock/subsys/plague-builder-$PORT ]; then
+            stop_one $PORT
+            start_one $PORT
+        fi
+    done
 	return 0
 }
 
@@ -36,23 +73,23 @@
 
 case "$1" in
     start)
-	start
-	;;
+        start
+        ;;
     stop)
-	stop
-	;;
+        stop
+        ;;
     status)
-	status plague-builder
-	;;
+        status plague-builder
+        ;;
     restart)
-    	stop
-	start
-	;;
+        stop
+        start
+        ;;
     condrestart)
-	[ -f /var/lock/subsys/plague-builder ] && restart || :
-	;;
+        condrestart
+        ;;
     *)
-	echo "Usage: <servicename> {start|stop|status|reload|restart[|probe]"
+	   echo "Usage: <servicename> {start|stop|status|reload|restart[|probe]"
 	exit 1
 	;;
 esac




More information about the fedora-extras-commits mailing list