From bd4729f70cc9cd71d9defca1cd0dc82893bf8f10 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 17 Feb 2011 19:06:17 -0600 Subject: testing/xen: promote to main --- main/xen/xend.initd | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 main/xen/xend.initd (limited to 'main/xen/xend.initd') diff --git a/main/xen/xend.initd b/main/xen/xend.initd new file mode 100644 index 000000000..6958c0479 --- /dev/null +++ b/main/xen/xend.initd @@ -0,0 +1,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 +} -- cgit v1.2.3