]> git.proxmox.com Git - qemu-server.git/blame - qemu.init.d
add .gitignore
[qemu-server.git] / qemu.init.d
CommitLineData
1e3baf05
DM
1#! /bin/sh
2
3### BEGIN INIT INFO
4# Provides: qemu-server
5# Required-Start: $network $local_fs $remote_fs
6# Required-Stop: $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
12PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
13PROG=/usr/sbin/qm
14DESC="Qemu Server"
15
16test -x $PROG || exit 0
17
18set -e
19
20case "$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 ;;
43esac
44
45exit 0