ia64/xen-unstable

view tools/examples/init.d/xend @ 3002:a4f8b0734492

bitkeeper revision 1.1159.170.32 (419a593aACa3uJybVvoEJ_gaJcjDwA)

Merge freefall.cl.cam.ac.uk:/local/scratch/kaf24/xen-2.0-testing.bk
into freefall.cl.cam.ac.uk:/local/scratch/kaf24/xeno.bk
author kaf24@freefall.cl.cam.ac.uk
date Tue Nov 16 19:47:06 2004 +0000 (2004-11-16)
parents c7b0154dff73 adea3db0783f
children f0fe276ae088 dde87d5385db 0dc3b8b8c298
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 # Wait for Xend / Xfrd to be up
11 function await_daemons_up
12 {
13 i=1
14 rets=10
15 xend status
16 while [ $? -ne 0 -a $i -lt $rets ]; do
17 sleep 1
18 echo -n .
19 i=$(($i + 1))
20 xend status
21 done
22 }
24 case "$1" in
25 start)
26 xend start
27 await_daemons_up
28 ;;
29 stop)
30 xend stop
31 ;;
32 status)
33 xend status
34 ;;
35 restart|reload)
36 xend restart
37 await_daemons_up
38 ;;
39 *)
40 # do not advertise unreasonable commands that there is no reason
41 # to use with this device
42 echo $"Usage: $0 {start|stop|status|restart|reload}"
43 exit 1
44 esac
46 exit $?