]> git.pld-linux.org Git - packages/xen.git/blame - xend.init
- gah, wrong dir
[packages/xen.git] / xend.init
CommitLineData
2e8b91a6
JR
1#!/bin/sh
2#
3# xend Script to start and stop the Xen control daemon.
4#
88f02a9d 5# chkconfig: 2345 95 05
2e8b91a6
JR
6# description: Starts and stops the Xen control daemon.
7#
8### BEGIN INIT INFO
9# Provides: xend
88f02a9d 10# Required-Start: $syslog $remote_fs xenstored xenconsoled
2e8b91a6 11# Should-Start:
88f02a9d 12# Required-Stop: $syslog $remote_fs xenstored xenconsoled
2e8b91a6
JR
13# Should-Stop:
14# Default-Start: 2 3 4 5
15# Default-Stop: 0 1 6
16# Short-Description: Start/stop xend
17# Description: Starts and stops the Xen control daemon.
18### END INIT INFO
19
e7cf47bb
JR
20# Source function library.
21. /etc/rc.d/init.d/functions
22
2e8b91a6
JR
23start() {
24 if [ -f /var/lock/subsys/xend ]; then
25 msg_already_running "Xen control daemon"
26 return
27 fi
28 if [ ! -f /var/lock/subsys/xenconsoled -o ! -f /var/lock/subsys/xenstored ]; then
29 echo "xenconsoled and xenstored must be started first"
30 return
31 fi
7f560d13
JR
32 msg_starting "Starting Xen control daemon"
33 daemon /usr/sbin/xend
2e8b91a6 34 RETVAL=$?
7f560d13 35 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xend
2e8b91a6
JR
36}
37
38stop() {
39 if [ ! -f /var/lock/subsys/xend ]; then
40 msg_not_running "Xen control daemon"
41 return
42 fi
7f560d13
JR
43 msg_stopping "Stopping Xen control daemon"
44 killproc xend
2e8b91a6
JR
45 rm -f /var/lock/subsys/xend
46}
47
48reload() {
49 if [ ! -f /var/lock/subsys/xend ]; then
50 msg_not_running "Xen control daemon"
7f560d13
JR
51 RETVAL=7
52 else
53 msg_reloading "Reloading Xen control daemon"
54 killproc /usr/sbin/xend -HUP
55 RETVAL=$?
2e8b91a6 56 fi
2e8b91a6
JR
57}
58
7f560d13 59condrestart() {
2e8b91a6
JR
60 if [ ! -f /var/lock/subsys/xend ]; then
61 msg_not_running "Xen control daemon"
7f560d13 62 RETVAL=$1
2e8b91a6 63 else
7f560d13
JR
64 stop
65 start
2e8b91a6
JR
66 fi
67}
68
69RETVAL=0
70# See how we were called.
71case "$1" in
72 start)
73 start
74 ;;
75 stop)
76 stop
77 ;;
7f560d13
JR
78 restart)
79 stop
80 start
81 ;;
82 try-restart)
83 condrestart 0
2e8b91a6 84 ;;
7f560d13 85 reload|force-reload)
2e8b91a6
JR
86 reload
87 ;;
7f560d13
JR
88 status)
89 status xend
90 exit $?
2e8b91a6
JR
91 ;;
92 *)
7f560d13 93 msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
2e8b91a6
JR
94 exit 3
95esac
96
97exit $RETVAL
This page took 0.082894 seconds and 4 git commands to generate.