summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2011-06-17 03:14:13 +0200
committerDominique Martinet <asmadeus@codewreck.org>2011-06-17 03:14:13 +0200
commit8235ec20d3c484420359b7326cdf278c420fc2e8 (patch)
treef40a504ca23515a514d4900d17089ff70b242b9a
parent927574f5574523e9bf8db522df3c1a4fa85ac5a6 (diff)
some enhancement to startup scripts: debian headers (berk), shut down all the local VMs and not just the autostart ones
-rwxr-xr-xstartup/kvm-wrapper-startup.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/startup/kvm-wrapper-startup.sh b/startup/kvm-wrapper-startup.sh
index a0bff94..92be7e1 100755
--- a/startup/kvm-wrapper-startup.sh
+++ b/startup/kvm-wrapper-startup.sh
@@ -1,8 +1,17 @@
-#!/bin/sh
+#!/bin/bash
+### BEGIN INIT INFO
+# Provides: kvm-wrapper
+# Required-Start: $remote_fs $syslog
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: kcm-wrapper init script
+# Description: This script starts a list of VMs and stops the running
+# ones when asked to
+### END INIT INFO
-# kvm-wrapper startup init script
-# This scripts starts/stops a list a VMs using the kvm-wrapper script
# -- bencoh, 2009/08/11
+# -- Asmadeus, 2011/06
SCRIPTNAME=/etc/init.d/kvm-wrapper
@@ -56,10 +65,9 @@ done
do_stop()
{
-grep -E -v '^#' "$KVM_VM_LIST" |
+"$KVM_WRAPPER" list|pcregrep "Running\ton (`hostname -s`|local)"|awk '{print $1}'|
while read line
do
- pcregrep "^KVM_CLUSTER_NODE=\"?`hostname -s`" $KVM_WRAPPER_DIR/vm/$line-vm >&/dev/null && \
stop_vm "$line"
done
}