1#!/bin/sh
2#
3# PROVIDE: xendriverdomain
4# REQUIRE: DAEMON
5#
6# Should be run in a driver domain, but not in domain 0.
7
8. /etc/rc.subr
9
10. @XEN_SCRIPT_DIR@/hotplugpath.sh
11
12LD_LIBRARY_PATH="${libdir}"
13export LD_LIBRARY_PATH
14
15name="xendriverdomain"
16rcvar="xendriverdomain_enable"
17start_cmd="xendriverdomain_start"
18stop_cmd="xendriverdomain_stop"
19extra_commands=""
20
21XLDEVD_PIDFILE="@XEN_RUN_DIR@/xldevd.pid"
22
23load_rc_config $name
24: ${xendriverdomain_enable:=no}
25
26xendriverdomain_start()
27{
28	printf "Starting xenservices: xl devd."
29
30	PATH="${bindir}:${sbindir}:$PATH" ${sbindir}/xl devd --pidfile ${XLDEVD_PIDFILE} ${XLDEVD_ARGS}
31
32	printf "\n"
33}
34
35xendriverdomain_stop()
36{
37	printf "Stopping xl devd.\n"
38
39	rc_pid=$(check_pidfile ${XLDEVD_PIDFILE} ${sbindir}/xl)
40
41	kill -${sig_stop:-TERM} $rc_pid
42	wait_for_pids $rc_pid
43}
44
45run_rc_command "$1"
46