]> git.pld-linux.org Git - packages/xen.git/blame - xenconsoled.init
- updated to 4.17.3
[packages/xen.git] / xenconsoled.init
CommitLineData
2e8b91a6
JR
1#!/bin/sh
2#
3# xenconsoled Script to start and stop xenconsoled
4#
5# chkconfig: 2345 70 10
6# description: Starts and stops xenconsoled
944e4f79 7#
2e8b91a6
JR
8
9# Source function library.
10. /etc/rc.d/init.d/functions
11
12# Read in configuration options.
13XENCONSOLED_ARGS=
14XENCONSOLED_LOG=none
15XENCONSOLED_LOG_DIR=/var/log/xen/console
16[ -f /etc/sysconfig/xenconsoled ] && . /etc/sysconfig/xenconsoled
17
18if [ "$1" = "start" -a -d /proc/xen -a ! -f /proc/xen/capabilities ] && \
19 ! grep -qs '^xenfs ' /proc/mounts >/dev/null; then
20 mount -t xenfs xenfs /proc/xen
21fi
22
23grep -qs "control_d" /proc/xen/capabilities || exit 0
24
25start() {
26 if [ -f /var/lock/subsys/xenconsoled ]; then
27 msg_already_running xenconsoled
28 return
29 fi
30 msg_starting xenconsoled
816fd8f1 31 daemon /usr/sbin/xenconsoled --pid-file=/var/run/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
2e8b91a6
JR
32 RETVAL=$?
33 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xenconsoled
34}
35
36stop() {
37 if [ ! -f /var/lock/subsys/xenconsoled ]; then
38 msg_not_running xenconsoled
39 return
40 fi
41 msg_stopping xenconsoled
42 killproc --pidfile /var/run/xenconsoled.pid xenconsoled
43 RETVAL=$?
44 rm -f /var/run/xenconsoled.pid >/dev/null 2>&1
45 rm -f /var/lock/subsys/xenconsoled >/dev/null 2>&1
46}
47
48RETVAL=0
49# See how we were called.
50case "$1" in
51 start)
52 start
53 ;;
54 status)
55 status xenconsoled
56 ;;
57 stop)
58 stop
59 ;;
60 force-reload|restart)
61 stop
62 start
63 ;;
64 *)
65 msg_usage "$0 {start|stop|status|restart|force-reload}"
66 exit 3
67esac
68
69exit $RETVAL
This page took 0.234821 seconds and 4 git commands to generate.