]> git.pld-linux.org Git - packages/xen.git/blob - xen-qemu-dom0-disk-backend.init
- rebuild with ocaml 4.04.1
[packages/xen.git] / xen-qemu-dom0-disk-backend.init
1 #!/bin/sh
2 #
3 # xenstored     Script to start and stop qemu for xen dom0 disk backend
4 #
5 # chkconfig:    2345 70 10
6 # description:  Starts and stops qemu for xen dom0 disk backend
7 #
8
9 # Source function library
10 . /etc/rc.d/init.d/functions
11
12
13 start () {
14         [ -d /proc/xen ] || exit 0
15         grep -qs "control_d" /proc/xen/capabilities || exit 0
16         [ -x /usr/bin/qemu-system-i386 ] || exit 0
17
18         if [ -f /var/lock/subsys/xen-qemu-dom0-disk-backend ]; then
19                 msg_already_running "qemu for xen dom0 disk backend"
20                 return
21         fi
22
23         msg_starting "qemu for xen dom0 disk backend"
24         daemon /usr/bin/qemu-system-i386 -xen-domid 0 \
25                 -xen-attach -name dom0 -nographic -M xenpv -daemonize \
26                 -monitor /dev/null -serial /dev/null -parallel /dev/null \
27                 -pidfile /var/run/qemu-dom0.pid
28
29         RETVAL=$?
30         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xen-qemu-dom0-disk-backend
31 }
32
33 stop() {
34         if [ ! -f /var/lock/subsys/xen-qemu-dom0-disk-backend ]; then
35                 msg_not_running "qemu for xen dom0 disk backend"
36                 return
37         fi
38         msg_stopping "qemu for xen dom0 disk backend"
39         killproc --pidfile /var/run/qemu-dom0.pid qemu-system-i386
40         RETVAL=$?
41         rm -f /var/run/qemu-dom0.pid >/dev/null 2>&1
42         rm -f /var/lock/subsys/xen-qemu-dom0-disk-backend >/dev/null 2>&1
43 }
44
45 RETVAL=0
46 # See how we were called.
47 case "$1" in
48   start)
49         start
50         ;;
51   status)
52         status --pidfile /var/run/qemu-dom0.pid xen-qemu-dom0-disk-backend qemu-system-i386
53         ;;
54   stop)
55         stop
56         ;;
57   force-reload|restart)
58         stop
59         start
60         ;;
61   *)
62         msg_usage "$0 {start|stop|status|restart|force-reload}"
63         exit 3
64 esac
65
66 exit $RETVAL
This page took 0.579477 seconds and 3 git commands to generate.