diff options
author | 2011-04-05 19:23:05 +0000 | |
---|---|---|
committer | 2011-04-05 19:23:05 +0000 | |
commit | d33534d5ad49c8256237a5495f6ff3d950d709d5 (patch) | |
tree | 7e6ccb33a17368a0f9110b51516ccfebb26c715b /app-emulation | |
parent | Fix dependencies, use Python 2 (bug #315841). (diff) | |
download | gentoo-2-d33534d5ad49c8256237a5495f6ff3d950d709d5.tar.gz gentoo-2-d33534d5ad49c8256237a5495f6ff3d950d709d5.tar.bz2 gentoo-2-d33534d5ad49c8256237a5495f6ff3d950d709d5.zip |
[app-emulation/xen-tools] Clean up. Add support for new xl framework. No need for xend
(Portage version: 2.2.0_alpha29/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation')
-rw-r--r-- | app-emulation/xen-tools/ChangeLog | 10 | ||||
-rw-r--r-- | app-emulation/xen-tools/files/xenconsoled.confd | 2 | ||||
-rw-r--r-- | app-emulation/xen-tools/files/xenconsoled.initd | 25 | ||||
-rw-r--r-- | app-emulation/xen-tools/files/xendomains.initd-xl | 117 | ||||
-rw-r--r-- | app-emulation/xen-tools/files/xenstored.confd | 2 | ||||
-rwxr-xr-x | app-emulation/xen-tools/files/xenstored.initd | 28 | ||||
-rw-r--r-- | app-emulation/xen-tools/xen-tools-4.1.0-r1.ebuild (renamed from app-emulation/xen-tools/xen-tools-4.1.0.ebuild) | 14 |
7 files changed, 194 insertions, 4 deletions
diff --git a/app-emulation/xen-tools/ChangeLog b/app-emulation/xen-tools/ChangeLog index f5d88e4eb792..765397a1e8b9 100644 --- a/app-emulation/xen-tools/ChangeLog +++ b/app-emulation/xen-tools/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-emulation/xen-tools # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.71 2011/03/26 19:16:00 alexxy Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.72 2011/04/05 19:23:05 alexxy Exp $ + +*xen-tools-4.1.0-r1 (05 Apr 2011) + + 05 Apr 2011; Alexey Shvetsov <alexxy@gentoo.org> -xen-tools-4.1.0.ebuild, + +xen-tools-4.1.0-r1.ebuild, +files/xenconsoled.confd, + +files/xenconsoled.initd, +files/xendomains.initd-xl, +files/xenstored.confd, + +files/xenstored.initd: + Clean up. Add support for new xl framework. No need for xend 26 Mar 2011; Alexey Shvetsov <alexxy@gentoo.org> xen-tools-4.1.0.ebuild: Fix build on some platforms diff --git a/app-emulation/xen-tools/files/xenconsoled.confd b/app-emulation/xen-tools/files/xenconsoled.confd new file mode 100644 index 000000000000..b2e194bde46f --- /dev/null +++ b/app-emulation/xen-tools/files/xenconsoled.confd @@ -0,0 +1,2 @@ +# /etc/conf.d/xenstored +XENCONSOLED_OPTS="" diff --git a/app-emulation/xen-tools/files/xenconsoled.initd b/app-emulation/xen-tools/files/xenconsoled.initd new file mode 100644 index 000000000000..12e4381529a2 --- /dev/null +++ b/app-emulation/xen-tools/files/xenconsoled.initd @@ -0,0 +1,25 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenconsoled.initd,v 1.1 2011/04/05 19:23:05 alexxy Exp $ + +depend() { + need xenstored +} + +start() { + ebegin "Starting xenconsoled daemon" + start-stop-daemon --start --exec /usr/sbin/xenconsoled \ + --pidfile /var/run/xenconsoled.pid \ + -- --pid-file=/var/run/xenconsoled.pid \ + ${XENCONSOLED_OPTS} + eend $* +} + +stop() { + ebegin "Stoping xenconsoled daemon" + start-stop-daemon --stop --exec /usr/sbin/xenconsoled \ + --pidfile /var/run/xenconsoled.pid + eend $* +} + diff --git a/app-emulation/xen-tools/files/xendomains.initd-xl b/app-emulation/xen-tools/files/xendomains.initd-xl new file mode 100644 index 000000000000..1470a77feecb --- /dev/null +++ b/app-emulation/xen-tools/files/xendomains.initd-xl @@ -0,0 +1,117 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xendomains.initd-xl,v 1.1 2011/04/05 19:23:05 alexxy Exp $ + +opts="start stop status restart" + +depend() { + need xenstored xenconsoled + 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/xl list "${1}" >/dev/null 2>&1 +} + +using_screen() { + [[ "${SCREEN}" == "yes" || "${SCREEN}" == "YES" ]] +} + +set_screen_cmd() { + screen_cmd="screen -c ${SCREENRC:-/dev/null} -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 -c ${SCREENRC:-/dev/null} -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:=/etc/xen/auto}/"* 2>/dev/null | sort); do + name=$(get_domname ${dom}) + if ! is_running ${name} ; then + ebegin " Starting domain ${name}" + if using_screen ; then + ${screen_cmd} screen -t ${name} xl create ${dom} -c + else + xl 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. + DOMAINS="$(ls "${AUTODIR:=/etc/xen/auto}/"* 2>/dev/null | sort -r)" + + if [[ "$PARALLEL_SHUTDOWN" = "yes" ]] ; then + for dom in $DOMAINS ; do + name=$(get_domname ${dom}) + if is_running ${name} ; then + ebegin " Asking domain ${name} to shutdown in the background..." + xl shutdown --wait ${name} >/dev/null & + else + einfo " Not stopping domain ${name} - not running" + fi + done + einfo " Waiting for shutdown of domains that are still running" + wait + eend $? + else + for dom in $DOMAINS ; do + name=$(get_domname ${dom}) + if is_running ${name} ; then + ebegin " Waiting for domain ${name} to shutdown" + xl shutdown --wait ${name} >/dev/null + eend $? + else + einfo " Not stopping domain ${name} - not running" + fi + done + fi + if using_screen ; then + if ${screen_cmd} sleep 0 >/dev/null 2>&1 ; then + ebegin "Closing screen session ${SCREEN_NAME}" + ${screen_cmd} quit + eend $? + else + eend 0 + fi + fi +} + +status() { + /usr/sbin/xl list +} diff --git a/app-emulation/xen-tools/files/xenstored.confd b/app-emulation/xen-tools/files/xenstored.confd new file mode 100644 index 000000000000..31b9293aa328 --- /dev/null +++ b/app-emulation/xen-tools/files/xenstored.confd @@ -0,0 +1,2 @@ +# /etc/conf.d/xenstored +XENSTORED_OPTS="" diff --git a/app-emulation/xen-tools/files/xenstored.initd b/app-emulation/xen-tools/files/xenstored.initd new file mode 100755 index 000000000000..9167f3393591 --- /dev/null +++ b/app-emulation/xen-tools/files/xenstored.initd @@ -0,0 +1,28 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/xenstored.initd,v 1.1 2011/04/05 19:23:05 alexxy Exp $ + +depend() { + need net + before xendomains sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp +} + +start() { + ebegin "Starting xenstored daemon" + start-stop-daemon --start --exec /usr/sbin/xenstored \ + --pidfile /var/run/xenstored.pid \ + -- --pid-file=/var/run/xenstored.pid \ + $XENSTORED_OPTS + eend $? + einfo "Setting domain0 name record" + /usr/bin/xenstore-write "/local/domain/0/name" "Domain-0" +} + +stop() { + ebegin "Stopping xenstored daemon" + start-stop-daemon --stop --exec /usr/sbin/xenstored \ + --pidfile /var/run/xenstored.pid + eend $? +} + diff --git a/app-emulation/xen-tools/xen-tools-4.1.0.ebuild b/app-emulation/xen-tools/xen-tools-4.1.0-r1.ebuild index 87275eee60d4..b845d4eb1d8d 100644 --- a/app-emulation/xen-tools/xen-tools-4.1.0.ebuild +++ b/app-emulation/xen-tools/xen-tools-4.1.0-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.1.0.ebuild,v 1.3 2011/03/26 19:16:00 alexxy Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-4.1.0-r1.ebuild,v 1.1 2011/04/05 19:23:05 alexxy Exp $ EAPI="3" @@ -174,7 +174,7 @@ src_install() { || die "install failed" # Remove RedHat-specific stuff - rm -rf "${D}"/etc/sysconfig + rm -r "${D}"/etc/sysconfig "${D}"/etc/init.d/xen* || die dodoc README docs/README.xen-bugtool docs/ChangeLog if use doc; then @@ -195,8 +195,16 @@ src_install() { || die "Couldn't install xen.initd" newconfd "${FILESDIR}"/xendomains.confd xendomains \ || die "Couldn't install xendomains.confd" - newinitd "${FILESDIR}"/xendomains.initd xendomains \ + newinitd "${FILESDIR}"/xendomains.initd-xl xendomains \ || die "Couldn't install xendomains.initd" + newinitd "${FILESDIR}"/xenstored.initd xenstored \ + || die "Couldn't install xenstored.initd" + newconfd "${FILESDIR}"/xenstored.confd xenstored \ + || die "Couldn't install xenstored.confd" + newinitd "${FILESDIR}"/xenconsoled.initd xenconsoled \ + || die "Couldn't install xenconsoled.initd" + newconfd "${FILESDIR}"/xenconsoled.confd xenconsoled \ + || die "Couldn't install xenconsoled.confd" if use screen; then cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains |