1#!/bin/bash
2#
3# /etc/init.d/xendomains
4# Wrapper to start / stop domains automatically when domain 0 boots / shuts down
5#
6# chkconfig: 345 99 00
7# description: Helper to start / stop Xen domains.
8#
9# This script is a wrapper init helper for the real workload horse script.
10# It should work on LSB-compliant systems.
11#
12### BEGIN INIT INFO
13# Provides:          xendomains
14# Required-Start:    $syslog $remote_fs xenstored xenconsoled
15# Should-Start:      xend
16# Required-Stop:     $syslog $remote_fs xenstored xenconsoled
17# Should-Stop:       xend
18# Default-Start:     2 3 5
19# Default-Stop:      0 1 6
20# Short-Description: Wrapper to start/stop secondary xen domains
21# Description:       Wrapper for starting / stopping domains automatically
22#                    when domain 0 boots / shuts down on systems using init.
23#                    The $LIBEXEC_BIN/xendomains helper is shared between init and
24#                    systemd systems.
25### END INIT INFO
26
27. @XEN_SCRIPT_DIR@/hotplugpath.sh
28
29case "$1" in
30    start)
31	$LIBEXEC_BIN/xendomains start
32	;;
33    stop)
34	$LIBEXEC_BIN/xendomains stop
35	;;
36    restart)
37	$LIBEXEC_BIN/xendomains restart
38	;;
39    reload)
40	$LIBEXEC_BIN/xendomains reload
41	;;
42    status)
43	$LIBEXEC_BIN/xendomains status
44	;;
45    *)
46	echo "Usage: $0 {start|stop|restart|reload|status}"
47	exit 3
48	;;
49esac
50exit $?
51