summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ross <aross@gentoo.org>2006-10-07 04:03:16 +0000
committerAndrew Ross <aross@gentoo.org>2006-10-07 04:03:16 +0000
commit74878efb7f80640602cebde720a8d00da339313a (patch)
tree7417dbe73c15edcaeef1dfeac4704caed384627d /app-emulation
parentxend should start before ntp-client (bug #144057). (diff)
downloadaross-74878efb7f80640602cebde720a8d00da339313a.tar.gz
aross-74878efb7f80640602cebde720a8d00da339313a.tar.bz2
aross-74878efb7f80640602cebde720a8d00da339313a.zip
/etc/init.d/xend now fails gracefully when started under a non-Xen kernel or unprivileged domain (bug #148486).
svn path=/; revision=20
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/xen-tools/Manifest8
-rw-r--r--app-emulation/xen-tools/files/xend.initd22
2 files changed, 20 insertions, 10 deletions
diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
index 3955a13..f303d07 100644
--- a/app-emulation/xen-tools/Manifest
+++ b/app-emulation/xen-tools/Manifest
@@ -26,10 +26,10 @@ AUX xend-init 854 RMD160 e19cc95563c3e128255f3575297bc0d35786b5a4 SHA1 820fa00dd
MD5 b8d59e2eba1f6b245eb22e39c01df78c files/xend-init 854
RMD160 e19cc95563c3e128255f3575297bc0d35786b5a4 files/xend-init 854
SHA256 3991a74268dd4bc8b6fe53ed784f3cd764eb7112844dee34f3115bcd15d33377 files/xend-init 854
-AUX xend.initd 865 RMD160 1e2b7333bb4622ed17af5a74f958dce945fff09d SHA1 a9e6bc64725dd3ca28ccfff404df9307e1302f3d SHA256 896695341b73be52dc7a200bf706e6dc575ae6bfec10ad1b461a1610c008f76e
-MD5 6b8e6dc37420417c11268227ea5d8ff1 files/xend.initd 865
-RMD160 1e2b7333bb4622ed17af5a74f958dce945fff09d files/xend.initd 865
-SHA256 896695341b73be52dc7a200bf706e6dc575ae6bfec10ad1b461a1610c008f76e files/xend.initd 865
+AUX xend.initd 993 RMD160 0d24a6f194976e0f7b9173a29c49b45e7acec656 SHA1 30344990846eaaf46b6cc7182f493fe14dcff1ae SHA256 339bcae98acd8137992c91e424d5bb805e11b29e5391215da24241ba710742ef
+MD5 bf51eb9bcb9a310dd7f9d7b90c0b2970 files/xend.initd 993
+RMD160 0d24a6f194976e0f7b9173a29c49b45e7acec656 files/xend.initd 993
+SHA256 339bcae98acd8137992c91e424d5bb805e11b29e5391215da24241ba710742ef files/xend.initd 993
AUX xendomains-screen.confd 594 RMD160 79c7a3546cf1d3f8558c2120d6e8c93c753e66b9 SHA1 7f9ed2986495d5fa4a6f8b050cd632fde6a19994 SHA256 c4d7ffcdbeccc5e93460e2abbf70d642a78a363d79ccbbce0407f50cace54e0a
MD5 65a57a4fae5a300aed8b84c24cdeee42 files/xendomains-screen.confd 594
RMD160 79c7a3546cf1d3f8558c2120d6e8c93c753e66b9 files/xendomains-screen.confd 594
diff --git a/app-emulation/xen-tools/files/xend.initd b/app-emulation/xen-tools/files/xend.initd
index c1af7c1..d7e3bd2 100644
--- a/app-emulation/xen-tools/files/xend.initd
+++ b/app-emulation/xen-tools/files/xend.initd
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xend-init,v 1.1 2006/03/24 23:55:01 agriffis Exp $
+# $Header: $
opts="start stop status restart"
@@ -18,11 +18,21 @@ await_daemons_up() {
return 1
}
+is_privileged_domain() {
+ grep -qsE '^control_d$' /proc/xen/capabilities
+ return $?
+}
+
start() {
- ebegin "Starting Xen control daemon"
- /usr/sbin/xend start
- /usr/sbin/xend status || await_daemons_up
- eend $?
+ if is_privileged_domain ; then
+ ebegin "Starting Xen control daemon"
+ /usr/sbin/xend start
+ /usr/sbin/xend status || await_daemons_up
+ eend $?
+ else
+ eerror "Can't start xend - this is not a privileged domain."
+ return 1
+ fi
}
stop() {
@@ -38,5 +48,5 @@ stop() {
}
status() {
- /usr/sbin/xend status
+ is_privileged_domain && /usr/sbin/xend status
}