ia64/xen-unstable

view tools/examples/init.d/xend @ 6689:7d0fb56b4a91

merge?
author cl349@firebug.cl.cam.ac.uk
date Wed Sep 07 19:01:31 2005 +0000 (2005-09-07)
parents 38c5199155fc fc5081a78657
children b2f4823b6ff0 b35215021b32 9af349b055e5 3233e7ecfa9f
line source
1 #!/bin/bash
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.
10 if ! [ -e /proc/xen/privcmd ]; then
11 exit 0
12 fi
14 # Wait for Xend to be up
15 function await_daemons_up
16 {
17 i=1
18 rets=10
19 xend status
20 while [ $? -ne 0 -a $i -lt $rets ]; do
21 sleep 1
22 echo -n .
23 i=$(($i + 1))
24 xend status
25 done
26 }
28 case "$1" in
29 start)
30 xend start
31 await_daemons_up
32 ;;
33 stop)
34 xend stop
35 ;;
36 status)
37 xend status
38 ;;
39 restart|reload|force-reload)
40 xend restart
41 await_daemons_up
42 ;;
43 *)
44 # do not advertise unreasonable commands that there is no reason
45 # to use with this device
46 echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}"
47 exit 1
48 esac
50 exit $?