aboutsummaryrefslogtreecommitdiffstats
path: root/testing/xen/xend.initd
blob: 6958c0479f702b0a55f4b3a7acd3015f586f4fbc (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
35
36
37
38
#!/sbin/runscript

depend() {
	need net
	before xendomains sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
}

is_privileged_domain() {
	grep -qsE '^control_d$' /proc/xen/capabilities
	return $?
}

start() {
	if is_privileged_domain ; then
		ebegin "Starting Xen daemons"
		/usr/sbin/xend start
		eend $?
	else
		eerror "Can't start xend - not a privileged domain"
		return 1
	fi
}

stop() {
	ebegin "Stopping Xen control daemon"
	/usr/sbin/xend stop
	eend $?
}

restart() {
	ebegin "Restarting Xen control daemon"
	/usr/sbin/xend restart
	eend $?
}

status() {
	is_privileged_domain && /usr/sbin/xend status
}