qemu-server/qemu.init.d
Dietmar Maurer 9b4ea96225 Fix startup order
Also depend on pve-cluster and redhat-cluster-pve.
2011-08-30 15:11:54 +02:00

46 lines
1.0 KiB
Bash

#! /bin/sh
### BEGIN INIT INFO
# Provides: qemu-server
# Required-Start: pve-cluster cman $network $local_fs $remote_fs
# Required-Stop: pve-cluster cman $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start all qemu/kvm virtual machines
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
PROG=/usr/sbin/qm
DESC="Qemu Server"
test -x $PROG || exit 0
set -e
case "$1" in
start)
(egrep '^flags.*svm' /proc/cpuinfo >/dev/null && modprobe -q kvm-amd) ||
(egrep '^flags.*vmx' /proc/cpuinfo >/dev/null && modprobe -q kvm-intel) ||
echo "unable to load kvm module"
# recent distributions use tmpfs for /var/run
# and /var/lock to avoid to clean it up on every boot.
# they also assume that init scripts will create
# required subdirectories for proper operations
mkdir -p /var/run/qemu-server
mkdir -p /var/lock/qemu-server
$PROG startall
;;
stop)
$PROG stopall
;;
force-reload)
;;
restart)
# nothing to do, because we are no real daemon
;;
esac
exit 0