mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
The removal of the udev rules highlighted that although it has been replaced by "xl devd" there isn't an initscript to replace it. To enable this add a --pidfile option to xl devd. Tested on Linux by running the script in dom0 and checking the daemon was started/stopped, but not in an actual driver domain environment since I don't have one conveniently available. I also checked that running without the --pidfile option still works. Scripts mainly cribbed from the xencommons for each platform. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Roger Pau Monné <roger.pau@citrix.com> Cc: Konrad Rzeszutek Wilk <konrad@darnok.org> Cc: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com>
50 lines
821 B
Bash
50 lines
821 B
Bash
#!/bin/sh
|
|
#
|
|
# PROVIDE: xendriverdomain
|
|
# REQUIRE: DAEMON
|
|
#
|
|
# Should be run in a driver domain, but not in domain 0.
|
|
|
|
. /etc/rc.subr
|
|
|
|
DIR=$(dirname "$0")
|
|
. "${DIR}/xen-hotplugpath.sh"
|
|
|
|
LD_LIBRARY_PATH="${libdir}"
|
|
export LD_LIBRARY_PATH
|
|
|
|
name="xendriverdomain"
|
|
start_precmd="xendriverdomain_precmd"
|
|
start_cmd="xendriverdomain_startcmd"
|
|
stop_cmd="xendriverdomain_stop"
|
|
extra_commands=""
|
|
|
|
XLDEVD_PIDFILE="/var/run/xldevd.pid"
|
|
|
|
xendriverdomain_precmd()
|
|
{
|
|
:
|
|
}
|
|
|
|
xendriverdomain_startcmd()
|
|
{
|
|
printf "Starting xenservices: xl devd."
|
|
|
|
${sbindir}/xl devd --pidfile=$XLDEVD_PIDFILE ${XLDEVD_ARGS}
|
|
|
|
printf "\n"
|
|
}
|
|
|
|
xendriverdomain_stop()
|
|
{
|
|
printf "Stopping xl devd.\n"
|
|
|
|
rc_pid=$(check_pidfile ${XLDEVD_PIDFILE} ${sbindir}/xl)
|
|
|
|
kill -${sig_stop:-TERM} $rc_pids
|
|
wait_for_pids $rc_pids
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|