diff options
author | Benedikt Boehm <hollow@gentoo.org> | 2006-09-15 06:55:39 +0000 |
---|---|---|
committer | Benedikt Boehm <hollow@gentoo.org> | 2006-09-15 06:55:39 +0000 |
commit | 394548f07b0d594bb5c9277b44a89f87bfc90adf (patch) | |
tree | 80c830ea95315a3a30c3735c9c8693b3929cac2e | |
parent | Updating the ebuild (another try :P). (diff) | |
download | overlay-394548f07b0d594bb5c9277b44a89f87bfc90adf.tar.gz overlay-394548f07b0d594bb5c9277b44a89f87bfc90adf.tar.bz2 overlay-394548f07b0d594bb5c9277b44a89f87bfc90adf.zip |
add util-vserver live svn ebuild
svn path=/; revision=51
-rw-r--r-- | sys-cluster/util-vserver-svn/Manifest | 15 | ||||
-rw-r--r-- | sys-cluster/util-vserver-svn/files/conf.d/vservers | 37 | ||||
-rw-r--r-- | sys-cluster/util-vserver-svn/files/digest-util-vserver-svn-9999 | 1 | ||||
-rwxr-xr-x | sys-cluster/util-vserver-svn/files/init.d/vservers | 107 | ||||
-rw-r--r-- | sys-cluster/util-vserver-svn/util-vserver-svn-9999.ebuild | 119 |
5 files changed, 279 insertions, 0 deletions
diff --git a/sys-cluster/util-vserver-svn/Manifest b/sys-cluster/util-vserver-svn/Manifest new file mode 100644 index 0000000..2d3d658 --- /dev/null +++ b/sys-cluster/util-vserver-svn/Manifest @@ -0,0 +1,15 @@ +AUX conf.d/vservers 1578 RMD160 11fb31684aa53f3575c0011cb346d662b7784e78 SHA1 891ad5d0f54a3ead93e114225974c580b3849d91 SHA256 f8376c99cde34b32c1447ab94905ec34f4c8c346d2f9c0788a341818ec7b4c47 +MD5 282a160e516cc1af59f5dfb372d67985 files/conf.d/vservers 1578 +RMD160 11fb31684aa53f3575c0011cb346d662b7784e78 files/conf.d/vservers 1578 +SHA256 f8376c99cde34b32c1447ab94905ec34f4c8c346d2f9c0788a341818ec7b4c47 files/conf.d/vservers 1578 +AUX init.d/vservers 2125 RMD160 95cecd8fc3378d54d7c7b5d98968381a5f2a095f SHA1 17b46a07ed0038834640c9acf6fbbb607ef07210 SHA256 be2e63a91badcf20810ce3fa333af232bd74057b7c0142264ff5c2f6cea5647e +MD5 12a1318baf75b9f65a11931dfac06fa5 files/init.d/vservers 2125 +RMD160 95cecd8fc3378d54d7c7b5d98968381a5f2a095f files/init.d/vservers 2125 +SHA256 be2e63a91badcf20810ce3fa333af232bd74057b7c0142264ff5c2f6cea5647e files/init.d/vservers 2125 +EBUILD util-vserver-svn-9999.ebuild 3202 RMD160 34c4a5489c9f2a0290875ed084e78dc7ee341d34 SHA1 549be24863e0d4f4775db41bcff7703fd445697f SHA256 15aeab89962bcb3c213e6ef1808a0f8b2cc1f0e1fc3e2ad45a96ccede7a5cc86 +MD5 f04c22a793f3155462fe8d7a8e121e88 util-vserver-svn-9999.ebuild 3202 +RMD160 34c4a5489c9f2a0290875ed084e78dc7ee341d34 util-vserver-svn-9999.ebuild 3202 +SHA256 15aeab89962bcb3c213e6ef1808a0f8b2cc1f0e1fc3e2ad45a96ccede7a5cc86 util-vserver-svn-9999.ebuild 3202 +MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-util-vserver-svn-9999 1 +RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-util-vserver-svn-9999 1 +SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-util-vserver-svn-9999 1 diff --git a/sys-cluster/util-vserver-svn/files/conf.d/vservers b/sys-cluster/util-vserver-svn/files/conf.d/vservers new file mode 100644 index 0000000..15e25c5 --- /dev/null +++ b/sys-cluster/util-vserver-svn/files/conf.d/vservers @@ -0,0 +1,37 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# A space-delimited list of vserver MARKS to start. +# Identification of vservers happens by +# putting the flavor into /etc/vservers/<vserver-id>/apps/init/mark. +# Note: on stop the init script will stop ALL running vservers +MARKS="default" + +# A space-delimited list of vservers to start +# This can be used together with MARKS or as a replacement +# Note: on stop the init script will stop ALL running vservers +#START_VSERVERS="" + +# Wether to start all vserver MARKS by default (supersedes MARKS) +# This will be enabled if STARTALL is set regardless of its content +# i.e. you have to comment to disable it +# Note: on stop the init script will stop ALL running vservers +#STARTALL=yes + +# Number of vservers which shall be started in parallel; since most +# initmethods are spending much time in sleeps, it is safe to +# use a high number here, though you should pay attention if you make +# use of depends in /etc/vservers as some services may not be up if +# started in parallel +#NUMPARALLEL=6 + +# The name of the vserver lock directory which is used by the init script +# to determine which MARKS have already been started (used within +# vstatus() to show the status of MARKS). Default should be good +# for everyone. Change at your own risk +#LOCKDIR=/var/lock/vservers + +# The location of util-vserver-vars +# This file contains variables to util-vserver scripts used within the +# init script. Change at your own risk. +#UTIL_VSERVER_VARS=/usr/lib/util-vserver/util-vserver-vars diff --git a/sys-cluster/util-vserver-svn/files/digest-util-vserver-svn-9999 b/sys-cluster/util-vserver-svn/files/digest-util-vserver-svn-9999 new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/sys-cluster/util-vserver-svn/files/digest-util-vserver-svn-9999 @@ -0,0 +1 @@ + diff --git a/sys-cluster/util-vserver-svn/files/init.d/vservers b/sys-cluster/util-vserver-svn/files/init.d/vservers new file mode 100755 index 0000000..52c1cd7 --- /dev/null +++ b/sys-cluster/util-vserver-svn/files/init.d/vservers @@ -0,0 +1,107 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +opts="${opts} vstatus" + +checkconfig() { + : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars} + if [[ ! -e ${UTIL_VSERVER_VARS} ]]; then + eerror "Cannot find util-vserver installation" + eerror "(the file '$UTIL_VSERVER_VARS' would be expected)" + exit 1 + fi + + source ${UTIL_VSERVER_VARS} + source ${_LIB_GENTOO_FUNCTIONS} + + : ${MARKS:=default} + : ${NUMPARALLEL:=1} + : ${LOCKDIR:=/var/lock/vservers} +} + +start() { + checkconfig + + ebegin "Unhiding /proc entries" + ${_VPROCUNHIDE} + eend $? + + if [[ -n ${STARTALL} ]]; then + ebegin "Starting all types of vservers" + ${_START_VSERVERS} -j ${NUMPARALLEL} --all --start + local rc=$? + [[ $rc -eq 0 ]] && touch ${LOCKDIR}/all + eend $rc + else + for MARK in ${MARKS}; do + ebegin "Starting vservers of type '${MARK}'" + ${_START_VSERVERS} -m ${MARK} -j ${NUMPARALLEL} --all --start + local rc=$? + [[ $rc -eq 0 ]] && touch ${LOCKDIR}/${MARK} + eend $rc + done + fi + + for VSERVER in ${START_VSERVERS}; do + ebegin "Starting single vserver '${VSERVER}'" + ${_VSERVER} ${VSERVER} start + eend $? + done +} + +stop() { + checkconfig + + ebegin "Stopping all types of vservers" + ${_START_VSERVERS} -j ${NUMPARALLEL} --all --stop + eend $? + + rm -f ${LOCKDIR}/* + + einfo "Checking for vservers still running ..." + + for i in $(vs_running_name 1); do + ebegin " Stopping single vserver: ${i}" + /usr/sbin/vserver ${i} stop &> /dev/null + eend $? + done +} + +vstatus() { + checkconfig + + local running="false" + + einfo "${LOCKDIR} shows the following types of vservers running:" + + for i in $( ls ${LOCKDIR} | sort ); do + einfo " ${i}" + running="true" + done + + if [[ "${running}" != "true" ]]; then + einfo " none" + fi + + running="false" + + einfo + einfo "/proc/virtual/ says these are running:" + + for i in $(vs_running_name 1); do + einfo " ${i}" + running="true" + done + + if [[ "${running}" != "true" ]]; then + einfo " none" + fi + + + einfo + einfo "vserver-stat says these are running:" + /usr/sbin/vserver-stat +} + +# vim:ts=4:filetype=gentoo-init-d diff --git a/sys-cluster/util-vserver-svn/util-vserver-svn-9999.ebuild b/sys-cluster/util-vserver-svn/util-vserver-svn-9999.ebuild new file mode 100644 index 0000000..572c433 --- /dev/null +++ b/sys-cluster/util-vserver-svn/util-vserver-svn-9999.ebuild @@ -0,0 +1,119 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-cluster/util-vserver/util-vserver-0.30.210-r18.ebuild,v 1.2 2006/09/07 08:34:50 hollow Exp $ + +inherit autotools eutils toolchain-funcs bash-completion subversion + +DESCRIPTION="Linux-VServer admin utilities" +HOMEPAGE="http://www.nongnu.org/util-vserver/" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86" + +IUSE="legacy" + +DEPEND=">=dev-libs/dietlibc-0.28 + dev-libs/beecrypt + net-firewall/iptables + net-misc/vconfig + sys-apps/iproute2 + sys-process/procps" + +RDEPEND="sys-apps/iproute2 + net-misc/vconfig + net-firewall/iptables + dev-libs/beecrypt + sys-process/procps" + +ESVN_REPO_URI="http://svn.linux-vserver.org/svn/util-vserver/trunk" + +pkg_setup() { + if [[ -z "${VDIRBASE}" ]]; then + einfo + einfo "You can change the default vserver base directory (/vservers)" + einfo "by setting the VDIRBASE environment variable." + fi + + : ${VDIRBASE:=/vservers} + + einfo + einfo "Using \"${VDIRBASE}\" as vserver base directory" + einfo + + myconf="${myconf} --with-vrootdir=${VDIRBASE}" + + # default paths + myconf="${myconf} --localstatedir=/var" + myconf="${myconf} --with-initrddir=/etc/init.d" + + # needed for older vserver kernels not in portage (default: v13,net) + # we provide this just for convenience for people using self-made kernels + use legacy && myconf="${myconf} --enable-apis=compat,v11,fscompat,v13,net" +} + +src_unpack() { + subversion_src_unpack + + AT_M4DIR="-I m4" \ + eautoreconf +} + +src_compile() { + econf ${myconf} || die "econf failed" + emake || die "emake failed" +} + +src_install() { + make DESTDIR="${D}" install || die "install failed" + + # keep dirs + keepdir /var/run/vservers + keepdir /var/run/vservers.rev + keepdir /var/run/vshelper + keepdir /var/lock/vservers + keepdir /var/cache/vservers + + keepdir "${VDIRBASE}" + fperms 000 "${VDIRBASE}" + + # remove the non-gentoo init-scripts: + rm -f "${D}"/etc/init.d/* + + # and install gentoo'ized ones: + doinitd "${FILESDIR}"/init.d/vservers + doconfd "${FILESDIR}"/conf.d/vservers + + # bash-completion +# dobashcompletion contrib/bash_completion util-vserver + + dodoc README ChangeLog NEWS AUTHORS THANKS util-vserver.spec +} + +pkg_postinst() { + einfo + einfo "You have to run the vprocunhide command after every reboot" + einfo "in order to setup /proc permissions correctly for vserver" + einfo "use. An init script has been installed by this package." + einfo "To use it you should add it to a runlevel:" + einfo + einfo " rc-update add vservers default" + einfo + einfo "This init script will also help you to start/stop your vservers" + einfo "on reboot. See ${ROOT}etc/conf.d/vserver for details" + ewarn + ewarn "You should definitly fix up the barrier of your vserver" + ewarn "base directory by using the following command in a root shell:" + ewarn + ewarn " setattr --barrier ${VDIRBASE}" + ewarn + ewarn "IMPORTANT UPGRADE WARNING:" + ewarn + ewarn "Since 0.30.208-r3 the vprocunhide init-script has been merged" + ewarn "with the vservers init script. The following steps are" + ewarn "required to keep current behaviour:" + ewarn + ewarn " rc-update del vprocunhide" + ewarn " rc-update add vservers default" + ewarn +} |