summaryrefslogtreecommitdiffstats
path: root/testing/xen/xend.initd
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2011-01-02 11:28:21 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2011-01-02 11:28:21 +0000
commitdc1918baac00be158972968a6dda8ff4ad2107f1 (patch)
treee2ef89e6a88527e87e8989806cf1d61ec6040a9d /testing/xen/xend.initd
parent984c3c8466c7812969f00ed43faba9b07c9c921c (diff)
parentb6fc756fdef7522cc740448075192a31591ee10a (diff)
downloadaports-dc1918baac00be158972968a6dda8ff4ad2107f1.tar.bz2
aports-dc1918baac00be158972968a6dda8ff4ad2107f1.tar.xz
Merge remote branch 'ncopa/master'
Diffstat (limited to 'testing/xen/xend.initd')
-rw-r--r--testing/xen/xend.initd38
1 files changed, 38 insertions, 0 deletions
diff --git a/testing/xen/xend.initd b/testing/xen/xend.initd
new file mode 100644
index 000000000..6958c0479
--- /dev/null
+++ b/testing/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
+}