]> git.pld-linux.org Git - packages/xen.git/blame_incremental - xen-xend.init
- separated -libs
[packages/xen.git] / xen-xend.init
... / ...
CommitLineData
1#!/bin/sh
2#
3# xend Script to start and stop the Xen control daemon.
4#
5# Author: Keir Fraser <keir.fraser@cl.cam.ac.uk>
6#
7# chkconfig: 2345 98 01
8# description: Starts and stops the Xen control daemon.
9
10# Source function library
11. /etc/rc.d/init.d/functions
12
13if ! [ -e /proc/xen/privcmd ]; then
14 exit 0
15fi
16
17await_daemons_up()
18{
19 retval=$1
20 i=1
21 rets=10
22 /usr/sbin/xend status
23 while [ $? -ne 0 -a $i -lt $rets ]; do
24 sleep 1
25 i=$(($i + 1))
26 /usr/sbin/xend status > /dev/null 2>&1
27 done
28}
29
30RETVAL=0
31
32case "$1" in
33 start)
34 if [ ! -f /var/lock/subsys/xend ]; then
35 msg_starting "xend"
36 daemon /usr/sbin/xend start
37 RETVAL=$?
38 await_daemons_up
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xend
40 else
41 msg_already_running xend
42 fi
43 ;;
44 stop)
45 if [ -f /var/lock/subsys/xend ]; then
46 msg_stopping "xend"
47 daemon /usr/sbin/xend stop
48 rm -f /var/lock/subsys/xend >/dev/null 2>&1
49 else
50 msg_not_running "xend"
51 fi
52 ;;
53 status)
54 /usr/sbin/xend status
55 ;;
56 restart|force-reload)
57 $0 stop
58 $0 start
59 ;;
60 *)
61 # do not advertise unreasonable commands that there is no reason
62 # to use with this device
63 echo $"Usage: $0 {start|stop|status|restart|force-reload}"
64 exit 3
65esac
66
67exit $RETVAL
68
This page took 0.031702 seconds and 4 git commands to generate.