aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/xend.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/xen/xend.initd')
-rw-r--r--main/xen/xend.initd38
1 files changed, 38 insertions, 0 deletions
diff --git a/main/xen/xend.initd b/main/xen/xend.initd
new file mode 100644
index 0000000000..6958c0479f
--- /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
+}