summaryrefslogtreecommitdiff
blob: 44186ddca059cfb5096638bd218897c0388f740e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/sbin/openrc-run
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

depend() {
	need xenstored
	after lvm
}

# bug #498720
shutdown_all_domU() {
	# Note: shutdown all domU, including manually started ones
	local V=$(xl info| awk "/xen_minor/ { print \$3 }")
	# 4.2.2 do not support "-a" option
	[ $V -gt 2 ] && xl shutdown -a -w >/dev/null
}

start() {
	ebegin "Starting xenconsoled daemon"
	start-stop-daemon --start --exec /usr/sbin/xenconsoled \
		--pidfile /run/xenconsoled.pid \
		-- --pid-file=/run/xenconsoled.pid \
		${XENCONSOLED_OPTS}
	eend $*
}

stop() {
	ebegin "Stopping xenconsoled daemon"
	shutdown_all_domU
	start-stop-daemon --stop --exec /usr/sbin/xenconsoled \
		--pidfile /run/xenconsoled.pid
	eend $*
}