]> git.proxmox.com Git - qemu-server.git/blob - qemu.init.d
mark iscsi service optional in init.d
[qemu-server.git] / qemu.init.d
1 #! /bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides: qemu-server
5 # Required-Start: +iscsi pve-cluster cman clvm $network $local_fs $remote_fs
6 # Required-Stop: +iscsi pve-cluster cman clvm $network $local_fs $remote_fs
7 # Default-Start: 2 3 4 5
8 # Default-Stop: 0 1 6
9 # Short-Description: start all qemu/kvm virtual machines
10 ### END INIT INFO
11
12 PATH=/sbin:/bin:/usr/sbin:/usr/bin
13 PROG=/usr/sbin/qm
14 DESC="Qemu Server"
15
16 test -x $PROG || exit 0
17
18 set -e
19
20 case "$1" in
21 start)
22 (egrep '^flags.*svm' /proc/cpuinfo >/dev/null && modprobe -q kvm-amd) ||
23 (egrep '^flags.*vmx' /proc/cpuinfo >/dev/null && modprobe -q kvm-intel) ||
24 echo "unable to load kvm module"
25
26 # recent distributions use tmpfs for /var/run
27 # and /var/lock to avoid to clean it up on every boot.
28 # they also assume that init scripts will create
29 # required subdirectories for proper operations
30 mkdir -p /var/run/qemu-server
31 mkdir -p /var/lock/qemu-server
32
33 $PROG startall
34 ;;
35 stop)
36 $PROG stopall
37 ;;
38 force-reload)
39 ;;
40 restart)
41 # nothing to do, because we are no real daemon
42 ;;
43 esac
44
45 exit 0