Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8e0794a4ae
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (37 sloc) 1.104 kb
#!/bin/sh
#
# /etc/init.d/init.d-xapi-domains
# Stop domains automatically when domain 0 shuts down.
#
# chkconfig: 345 99 00
# description: Start/stop XE VMs
SHUTDOWN="@LIBEXECDIR@/shutdown"
if [ ! -e /proc/xen/privcmd ] || \
[ ! -e @INVENTORY@ ] || \
[ ! -e ${SHUTDOWN} ] ; then
exit 0
fi
. /etc/init.d/functions
. @INVENTORY@
if [ "x${INSTALLATION_UUID}" = "x" ] ; then
exit 1
fi
case "$1" in
start)
# Need this to be present so that we get run on shutdown.
touch /var/lock/subsys/xapi-domains
# Fork background thread to wait for xapi to complete initialisation
# and then try and start vms with auto_poweron=true in other-config
@BINDIR@/xapi-autostart-vms &
;;
stop)
action $"Shutting down Virtual Machines: " \
${SHUTDOWN} "${INSTALLATION_UUID}"
action $"Terminating remaining Virtual Machines: " \
${SHUTDOWN} --force "${INSTALLATION_UUID}"
[ -f /var/lock/subsys/xapi-domains ] && rm -f /var/lock/subsys/xapi-domains
;;
*)
echo "Usage: $0 [start|stop]"
;;
esac
Jump to Line
Something went wrong with that request. Please try again.