summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ross <aross@gentoo.org>2006-10-07 07:24:35 +0000
committerAndrew Ross <aross@gentoo.org>2006-10-07 07:24:35 +0000
commiteb638049834563fd50cf4401ffe0d1b79cf26fdd (patch)
treea1499bfee2a8dcdee6f43fdbb97816f6001f5536
parent/etc/init.d/xend now fails gracefully when started under a non-Xen kernel or ... (diff)
downloadaross-eb638049834563fd50cf4401ffe0d1b79cf26fdd.tar.gz
aross-eb638049834563fd50cf4401ffe0d1b79cf26fdd.tar.bz2
aross-eb638049834563fd50cf4401ffe0d1b79cf26fdd.zip
/etc/init.d/xendomains now correctly handles domains with numbers, periods, and hyphens in them (bug #148628).
svn path=/; revision=21
-rw-r--r--app-emulation/xen-tools/Manifest12
-rwxr-xr-xapp-emulation/xen-tools/files/3.0.2-r4/xendomains.initd96
-rw-r--r--app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild2
3 files changed, 105 insertions, 5 deletions
diff --git a/app-emulation/xen-tools/Manifest b/app-emulation/xen-tools/Manifest
index f303d07..6b3fb25 100644
--- a/app-emulation/xen-tools/Manifest
+++ b/app-emulation/xen-tools/Manifest
@@ -1,3 +1,7 @@
+AUX 3.0.2-r4/xendomains.initd 2168 RMD160 c6dc22f50cf575393cb076c2abfff8b3f24b5540 SHA1 a7f75a7aff0ffdb3ca330f853855b888cfb7f752 SHA256 ed1adcb24e5ffe1c0abc33d6bd69f129b31b3d4f068222ee343809a8dd12b8d0
+MD5 a3b477fa44710894c47b0aeca7d6a57a files/3.0.2-r4/xendomains.initd 2168
+RMD160 c6dc22f50cf575393cb076c2abfff8b3f24b5540 files/3.0.2-r4/xendomains.initd 2168
+SHA256 ed1adcb24e5ffe1c0abc33d6bd69f129b31b3d4f068222ee343809a8dd12b8d0 files/3.0.2-r4/xendomains.initd 2168
AUX xen-consoles.logrotate 63 RMD160 035bd8baf1ba68a5525bab4379c0c4e350001a74 SHA1 6f88a4da3349aade6070dfc5c4465e2c00f3e68c SHA256 0da87a4b9094f934e3de937e8ef8d3afc752e76793aa3d730182d0241e118b19
MD5 9df68ac65dc3f372f5d61183abdc83ff files/xen-consoles.logrotate 63
RMD160 035bd8baf1ba68a5525bab4379c0c4e350001a74 files/xen-consoles.logrotate 63
@@ -47,10 +51,10 @@ EBUILD xen-tools-3.0.2-r3.ebuild 5530 RMD160 fe932ebe8722970f5a433a0619552c6ec2f
MD5 11588a83ffd3177430efeca5cc668ba3 xen-tools-3.0.2-r3.ebuild 5530
RMD160 fe932ebe8722970f5a433a0619552c6ec2f93eaf xen-tools-3.0.2-r3.ebuild 5530
SHA256 cff3399ef7a791cafcf2053c00124ab56772b730ac8aa32a088ced857b011c1e xen-tools-3.0.2-r3.ebuild 5530
-EBUILD xen-tools-3.0.2-r4.ebuild 5293 RMD160 7576bf11b7324a6b744db3cbf63a4ce5463d0934 SHA1 90ac80366cec3baff441834bcc946276df48b6a5 SHA256 5f2c8906df549e2e2723ab2ee8c76efefba706268aa2e802754f13e44b784438
-MD5 5d7b6da3e73ebbded6c78eb1e97238e7 xen-tools-3.0.2-r4.ebuild 5293
-RMD160 7576bf11b7324a6b744db3cbf63a4ce5463d0934 xen-tools-3.0.2-r4.ebuild 5293
-SHA256 5f2c8906df549e2e2723ab2ee8c76efefba706268aa2e802754f13e44b784438 xen-tools-3.0.2-r4.ebuild 5293
+EBUILD xen-tools-3.0.2-r4.ebuild 5300 RMD160 0d9825d94857a0e6d94d2814793641b0379b02cc SHA1 f8ec0796dc867da0c291b6d134c916fbd23c33cf SHA256 029e5f214644ee7cc3f3089d6fa4210c8be59bd34414518e50ac28fcabe440c6
+MD5 6ddd5b799276dded36c5dba765d84cde xen-tools-3.0.2-r4.ebuild 5300
+RMD160 0d9825d94857a0e6d94d2814793641b0379b02cc xen-tools-3.0.2-r4.ebuild 5300
+SHA256 029e5f214644ee7cc3f3089d6fa4210c8be59bd34414518e50ac28fcabe440c6 xen-tools-3.0.2-r4.ebuild 5300
MD5 6618adc624bc8ab64af0f4555c33529a files/digest-xen-tools-3.0.2-r3 235
RMD160 ad3a1d2a82c40b0bca653431c2d7964809580e5e files/digest-xen-tools-3.0.2-r3 235
SHA256 274536fc8a3cb10fda114e533062b0dbddcda4ae15f52033a39b85785b221794 files/digest-xen-tools-3.0.2-r3 235
diff --git a/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd b/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd
new file mode 100755
index 0000000..6b408f9
--- /dev/null
+++ b/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd
@@ -0,0 +1,96 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+opts="start stop status restart"
+
+depend() {
+ need xend
+ after dhcp
+}
+
+get_domname() {
+ local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1)
+
+ if [[ -z ${name_from_file} ]] ; then
+ basename "${1}"
+ else
+ echo ${name_from_file}
+ fi
+}
+
+is_running() {
+ /usr/sbin/xm list "${1}" >/dev/null 2>&1
+}
+
+using_screen() {
+ [[ "${SCREEN}" == "yes" || "${SCREEN}" == "YES" ]]
+}
+
+set_screen_cmd() {
+ screen_cmd="screen -q -r ${SCREEN_NAME:=xen} -X"
+}
+
+start() {
+ set_screen_cmd
+
+ einfo "Starting Xen domains from ${AUTODIR:=/etc/xen/auto}"
+ if using_screen ; then
+ ebegin "Creating screen session to hold domain consoles"
+ ( screen -d -m -S ${SCREEN_NAME} -t dom0 \
+ && ${screen_cmd} zombie dr \
+ && logrotate -f /etc/xen/xen-consoles.logrotate \
+ && ${screen_cmd} logfile /var/log/xen-consoles/%t.log \
+ && ${screen_cmd} logfile flush ${SCREEN_LOG_INTERVAL:-1} \
+ && ${screen_cmd} log on \
+ && ${screen_cmd} deflog on ) >/dev/null
+ if [[ $? -ne 0 ]] ; then
+ eend 1
+ return 1
+ else
+ eend
+ fi
+ fi
+ # Create all domains with config files in AUTODIR.
+ for dom in $(ls "${AUTODIR}/"* 2>/dev/null); do
+ name=$(get_domname ${dom})
+ if ! is_running ${name} ; then
+ ebegin " Starting domain ${name}"
+ if using_screen ; then
+ ${screen_cmd} screen -t ${name} xm create ${dom} -c
+ else
+ xm create --quiet ${dom}
+ fi
+ eend $?
+ else
+ einfo " Not starting domain ${name} - already running"
+ fi
+ done
+}
+
+stop() {
+ set_screen_cmd
+
+ einfo "Shutting down Xen domains from ${AUTODIR:=/etc/xen/auto}"
+ # Stop all domains with config files in AUTODIR.
+ for dom in $(ls "${AUTODIR}/"* 2>/dev/null); do
+ name=$(get_domname ${dom})
+ if is_running ${name} ; then
+ ebegin " Stopping domain ${name}"
+ xm shutdown --wait ${name} >/dev/null
+ eend $?
+ else
+ einfo " Not stopping domain ${name} - not running"
+ fi
+ done
+ if using_screen ; then
+ ebegin "Closing screen session ${SCREEN_NAME}"
+ ${screen_cmd} quit
+ eend $?
+ fi
+}
+
+status() {
+ /usr/sbin/xm list
+}
diff --git a/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild b/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild
index 0364cd6..bb91d14 100644
--- a/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild
+++ b/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild
@@ -156,7 +156,7 @@ src_install() {
newinitd "${FILESDIR}"/xend.initd xend
newconfd "${FILESDIR}"/xendomains.confd xendomains
- newinitd "${FILESDIR}"/xendomains.initd xendomains
+ newinitd "${FILESDIR}/${PVR}"/xendomains.initd xendomains
if use screen; then
cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains