diff options
author | Richard Yao <ryao@cs.stonybrook.edu> | 2012-04-14 00:46:35 -0400 |
---|---|---|
committer | Richard Yao <ryao@cs.stonybrook.edu> | 2012-04-14 00:46:35 -0400 |
commit | aa49399a69f165abd2ada35b37f5945aeec22689 (patch) | |
tree | 71fda19c32021d77e7c46459db0d93585448eb86 /kvm-init-script | |
parent | Many small changes (diff) | |
download | kvm-tools-aa49399a69f165abd2ada35b37f5945aeec22689.tar.gz kvm-tools-aa49399a69f165abd2ada35b37f5945aeec22689.tar.bz2 kvm-tools-aa49399a69f165abd2ada35b37f5945aeec22689.zip |
Minor fixes for residual issues
Diffstat (limited to 'kvm-init-script')
-rw-r--r-- | kvm-init-script | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/kvm-init-script b/kvm-init-script index 87d5a48..cec0ed6 100644 --- a/kvm-init-script +++ b/kvm-init-script @@ -13,8 +13,9 @@ DROP_USER=${DROP_USER:-nobody} MEMORY=${MEMORY:-512M} TIMEOUT=${TIMEOUT:-300} SMP=${SMP:-1} +export KVM_USER=${KVM_USER:-"root"} -opts="reboot" +extra_commands="reboot" depend() { need net.br0 @@ -22,16 +23,16 @@ depend() { send_command() { local command="socat -u - UNIX-CONNECT:${MONITOR}" - which nc6 2>&1 > /dev/null && command="nc6 -U ${MONITOR} --send-only" + which nc6 2> /dev/null > /dev/null && command="nc6 -U ${MONITOR} --send-only" echo "$@" | ${command} >/dev/null 2>&1 } sanity_check() { - if [ "${VMNAME}" = "${SVCNAME}" ]; then + if [ "${VMNAME}" != "${SVCNAME}" ]; then eerror "You have to create an init script for each vm:" eerror " ln -s vm /etc/init.d/vm.vmname" return 1 - elif [ ! -f "${DISKIMAGE}" ]; then + elif [ ! -f "${DISKIMAGE}" -a ! -b "${DISKIMAGE}" ]; then eerror "couldn't find \$DISKIMAGE '$DISKIMAGE'" return 1; fi |