summaryrefslogtreecommitdiffstats
path: root/testing/xen/xend.initd
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2010-12-27 18:37:21 -0600
committerWilliam Pitcock <nenolod@dereferenced.org>2010-12-28 21:15:44 -0600
commit6bb05082baccd776b01adae1768c010220c8a9aa (patch)
treeefb295686334d0b5533fc965919241ce35a35a71 /testing/xen/xend.initd
parentd16919042d04958d058eb71a618a8d0c4836789c (diff)
downloadaports-6bb05082baccd776b01adae1768c010220c8a9aa.tar.bz2
aports-6bb05082baccd776b01adae1768c010220c8a9aa.tar.xz
testing/xen: add initscripts for xend and xendomains.
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
+}