direct-io.hg

view tools/examples/init.d/xend @ 3495:dde87d5385db

bitkeeper revision 1.1159.223.22 (41f2c983tNSS8-VlWIzF9A78zTQx-w)

Description: add force-reload option
Debian policy requires init scripts to implement force-reload. So, alias
that to restart.

From: Adam Heath <doogie@brainfood.com>
Signed-off-by: ian.pratt@cl.cam.ac.uk
author iap10@labyrinth.cl.cam.ac.uk
date Sat Jan 22 21:45:39 2005 +0000 (2005-01-22)
parents a4f8b0734492
children 074d7606fd61 4d7f2d346576 a0be5e5a1f37
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|force-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|force-reload}"
43 exit 1
44 esac
46 exit $?