[Lunar-commits] CVS: lunar-tools/clad clad,1.3,1.4

Auke Kok sofar at lunar-linux.org
Tue Jan 18 13:54:31 UTC 2005


Update of /var/cvs/lunar/lunar-tools/clad
In directory espresso.foo-projects.org:/home/sofar/active/lunar-tools/clad

Modified Files:
	clad 
Log Message:
Adding bgrun functionality


Index: clad
===================================================================
RCS file: /var/cvs/lunar/lunar-tools/clad/clad,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- clad	29 Nov 2004 10:59:59 -0000	1.3
+++ clad	18 Jan 2005 13:54:29 -0000	1.4
@@ -32,6 +32,7 @@
     destroy     delete the cluster definition
     test        test if all nodes are reachable
     run         run a command on all nodes
+    brun        same as run but perform tasks simultaneously
     add         add a node to a cluster
     remove      remove a node from a cluster
     login       log in to a cluster
@@ -56,6 +57,10 @@
     clad run "name" "command"
         Run a command on a cluster
     
+    clad bgrun "name" "command"
+        Run a command on a cluster. The command will be started in the
+        background immediately on all nodes instead of one at a time
+    
     clad add "name" "node1" ["node2" ...]
         Add node(s) to a cluster
 
@@ -272,6 +277,30 @@
                 fi
             fi
         ;;
+        bgrun)
+            if [ -z "$2" ]; then
+                message "ERROR: can't run on all clusters yet"
+            else
+                CL=$2
+                shift 2
+                if [ ! -f "$CLAD_CONF_DIR/.$CL.id_dsa" ]; then
+                    message "No keys exist for cluster \"$CL\", cannot continue"
+                else
+                    cluster_login $CL
+                    for MEMBER in $(cat $CLAD_CONF_DIR/$CL); do
+                      (
+                        if ssh -q -i $CLAD_CONF_DIR/.$CL.id_dsa $USER@$MEMBER "$@"; then
+                            verbose_msg "member \"$MEMBER\" ran OK"
+                        else
+                            message "$MEMBER: FAILED"
+                        fi
+                      ) &
+                    done
+                    wait
+                    cluster_logout $CL
+                fi
+            fi
+            ;;
         login)
             if [ -n "$CLAD_DEGRADED" ]; then
                 message "ERROR: can't login when running in degraded mode"



More information about the Lunar-commits mailing list