aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/xend.initd
blob: ee26c3f3311bfe76cfb5190f16a0f5ed8f76428a (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 xencommons
	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
}