Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: ca-87377
Fetching contributors…

Cannot retrieve contributors at this time

executable file 99 lines (85 sloc) 2.334 kb
#! /bin/bash
#
# xapi Start/Stop xen services
#
# chkconfig: 2345 21 78
# description: Xen services required by xapi
# processname: xenstored, xenconsoled
# config: @ETCDIR@/rio.conf
# pidfile: /var/run/xenstored.pid, /var/run/xenconsoled.pid
[ -e /proc/xen ] || exit 0
# Source function library.
. /etc/init.d/functions
start() {
echo -n $"Starting xenstored: "
if [ -e /var/lock/subsys/xen ]; then
if [ -e /var/run/xenstored.pid ] && [ -e /proc/`cat /var/run/xenstored.pid` ]; then
echo -n $"cannot start xenstored: xenstored is already running.";
failure $"cannot start xenstored: xenstored already running.";
echo
return 1
fi
if [ -e /var/run/xenconsoled.pid ] && [ -e /proc/`cat /var/run/xenconsoled.pid` ]; then
echo -n $"cannot start xenconsoled: xenconsoled is already running.";
failure $"cannot start xenconsoled: xenconsoled already running.";
echo
return 1
fi
fi
# Existence of stampfile suppresses the access log (oem)
XENSTORED_ARG=""
[ ! -e @ETCDIR@/xenstored-no-access-log ] || XENSTORED_ARG="--no-access-log"
[ -e /var/lib/xenstored/tdb ] && mv -f /var/lib/xenstored/tdb /var/lib/xenstored/tdb.bak
"@BINDIR@/xenstored" ${XENSTORED_ARG}
/usr/sbin/xenconsoled
[ -d /var/log/blktap ] || mkdir /var/log/blktap
# Delete rubbish from xapi's private tree in xenstore, once per boot (not once per
# xapi invocation since the data should be persistent across xapi restarts)
xenstore-rm /xapi
# Delete any accumulated /vm entries, once per boot
xenstore-rm /vm
# start cdrommon on all physicals cdrom at startup
if [ -d /dev/xapi/cd ]; then
for i in `find /dev/xapi/cd/ ! -type d`; do "@LIBEXECDIR@/cdrommon" $i; done
else
logger "No physical CDROM devices detected; not starting cdrommon"
fi
echo
touch /var/lock/subsys/xen;
return $RETVAL
}
stop() {
echo -n $"Action not supported"
failure $"Action not supported"
echo
return 1;
}
rhstatus() {
status xapi
}
restart() {
echo -n $"Action not supported"
failure $"Action not supported"
echo
return 1;
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
rhstatus
;;
condrestart)
[ -f /var/lock/subsys/xapi ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
exit 1
esac
Jump to Line
Something went wrong with that request. Please try again.