diff options
author | William Pitcock <nenolod@dereferenced.org> | 2011-02-17 19:06:17 -0600 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2011-02-17 19:06:17 -0600 |
commit | bd4729f70cc9cd71d9defca1cd0dc82893bf8f10 (patch) | |
tree | 0c39c7f0f0dc3e39f1d6a5701b4256d56db51235 /main/xen/xend.initd | |
parent | f369602f6bfd7345808a67c2427e770e97f44ca5 (diff) | |
download | aports-bd4729f70cc9cd71d9defca1cd0dc82893bf8f10.tar.bz2 aports-bd4729f70cc9cd71d9defca1cd0dc82893bf8f10.tar.xz |
testing/xen: promote to main
Diffstat (limited to 'main/xen/xend.initd')
-rw-r--r-- | main/xen/xend.initd | 38 |
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 +} |