summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2008-10-13 09:25:59 +0000
committerPeter Volkov <pva@gentoo.org>2008-10-13 09:25:59 +0000
commit7e9fe9c93315a116cf97e4030388f0025125688e (patch)
treed2a761669e5ee27cac437bae118baec35309daa7 /sys-cluster/vzctl
parentUnmask openoffice-bin-3.0.0, officially released now (diff)
downloadhistorical-7e9fe9c93315a116cf97e4030388f0025125688e.tar.gz
historical-7e9fe9c93315a116cf97e4030388f0025125688e.tar.bz2
historical-7e9fe9c93315a116cf97e4030388f0025125688e.zip
Made scripts openvz compatible. Skipped revisions to have possibility to put major updates (e.g. security) without this changes applied.
Package-Manager: portage-2.2_rc11/cvs/Linux 2.6.26-gentoo-r1 i686
Diffstat (limited to 'sys-cluster/vzctl')
-rw-r--r--sys-cluster/vzctl/ChangeLog9
-rw-r--r--sys-cluster/vzctl/Manifest4
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.22-scripts-openrc.patch237
-rw-r--r--sys-cluster/vzctl/vzctl-3.0.22-r10.ebuild81
4 files changed, 329 insertions, 2 deletions
diff --git a/sys-cluster/vzctl/ChangeLog b/sys-cluster/vzctl/ChangeLog
index e9dc6eb09092..c94cedddaf77 100644
--- a/sys-cluster/vzctl/ChangeLog
+++ b/sys-cluster/vzctl/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-cluster/vzctl
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/ChangeLog,v 1.56 2008/07/28 20:58:31 pchrist Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/ChangeLog,v 1.57 2008/10/13 09:25:59 pva Exp $
+
+*vzctl-3.0.22-r10 (13 Oct 2008)
+
+ 13 Oct 2008; Peter Volkov <pva@gentoo.org>
+ +files/vzctl-3.0.22-scripts-openrc.patch, +vzctl-3.0.22-r10.ebuild:
+ Made scripts openvz compatible. Skipped revisions to have possibility to
+ put major updates (e.g. security) without this changes applied.
28 Jul 2008; Panagiotis Christopoulos <pchrist@gentoo.org> metadata.xml:
Update metadata.xml to include USE flag descriptions. Entries taken from
diff --git a/sys-cluster/vzctl/Manifest b/sys-cluster/vzctl/Manifest
index 045f606ff361..7bd46de14fb7 100644
--- a/sys-cluster/vzctl/Manifest
+++ b/sys-cluster/vzctl/Manifest
@@ -3,11 +3,13 @@ AUX vzctl-3.0.16-prevent-stripping.patch 1407 RMD160 beac951027ab76136ce2dc7f156
AUX vzctl-3.0.22-capability-fix.patch 1037 RMD160 d244af55f1eaf249d1db04e53ab452aeec5e32f5 SHA1 bb6699627ddedaa524e4858e3c46e3bce50fb1f1 SHA256 977eea8154c3276fbab5a091cd30cf5072e26e7a9957b3aaa4428eacd3be0e56
AUX vzctl-3.0.22-document-disable-modules.patch 843 RMD160 635e9417e3bbdef88d447f65e7d8007b89ba52ad SHA1 b6c1bc340ed29efe9ebf99d50b214b4c03e23379 SHA256 e2f4d5b3d3447eb6a4086ec3ff1ab5e8cc10797afe4febc3f06847a94430e6d5
AUX vzctl-3.0.22-glibc28.patch 758 RMD160 633a9feb1a7101a166aa8e090fac4b5720546d0c SHA1 d19fb01c59366eb97da8178864ddda88010b7110 SHA256 36021ca9dabe548075ca016db047131f3536f916b2fa620ed61b00c41545e19e
+AUX vzctl-3.0.22-scripts-openrc.patch 6804 RMD160 3535f073b8fd99749891e28dfb5843729f97e801 SHA1 58a124fe8de1893c2f8526502117b3cca86279da SHA256 2a94de0d088c1ef66cf0e568099ca5376bc166467f48a9e0b39610f309c17c8e
AUX vzctl-3.0.22-workaround-gentoo-add_ip.patch 1250 RMD160 d77d99b74ed55894a947d6651f3a8471f3f582ff SHA1 a3da293f85076cc8c86f68c128733e57ddba8b56 SHA256 b5d52398a85d947ceebcd7db17fbd6ec602bb03c338ec4af5b202a814e226730
DIST vzctl-3.0.18.tar.bz2 359655 RMD160 9c7169e151c6384fd489df3dd6392d442706f46f SHA1 35bc546f9af7254b1739bca9cead71b8dad04ca1 SHA256 8610efa9a8327a1b6457eaa28b772ad753db5f23c2c18b25bb3ce0cf6a929e2f
DIST vzctl-3.0.22.tar.bz2 360012 RMD160 53353981fefea94d997b3555600583f4c5818833 SHA1 58e5c55855aebf9e4ca032b325d8960a3836d648 SHA256 20f75e8342b85909d6bf01d0db47acaa088125da7f203b5e6e6169aa4c139166
EBUILD vzctl-3.0.18-r1.ebuild 1771 RMD160 96bca16be9a37a8e630856d7128322090bbc6eda SHA1 494d3c9626c0fa2c252186b663eb3284744f2e8e SHA256 1734e54adde38e4649214f56c13ff5575216a34ac5b263f08f4a8d1069dddc65
EBUILD vzctl-3.0.22-r1.ebuild 2587 RMD160 7dc6eb0555fc978b6a234e4fb6988a6394829b50 SHA1 00a65bb152621a0834c78607cc4d1aaf39037867 SHA256 a15b08beb6303d9244677eea27ab67ef3e577fa513beae5909ed05760d60df3f
+EBUILD vzctl-3.0.22-r10.ebuild 2613 RMD160 9bfa3722615f22e6e0b2efeefb738fa251ea9db0 SHA1 9916ed88dde7403d778df002f9356c91ee59eb53 SHA256 259d015efa14dc10434badfcc7a726fba49fe087f80ca4c7b4e4ce757c8ff481
EBUILD vzctl-3.0.22.ebuild 2316 RMD160 16e83e4cfe8e1ea49f062ec79d50e8749bb57d2d SHA1 e8588f3c09d88914548a8b152eeaacb1b84b3527 SHA256 240a995f88cd827e173bece0ff416995dcab3ae9321b63c80029e60e7be8ef4e
-MISC ChangeLog 10763 RMD160 88fd4dea1dab8c2605d7535d7ac0e9cfa7cc97b9 SHA1 1d74d548a0fbaa595f2251891920dd87c8ccd8a2 SHA256 e36ec5c4ebfda145446cc8c6b1e854698116c6a4bcf4fe9b13bb2a5a28c7ee20
+MISC ChangeLog 11049 RMD160 db53417f26f330cb0b412c0c678dcf17a2d30890 SHA1 26d0d4950c6e09d109139139619ce4c10ad7b4e4 SHA256 40dab48784a3f6c7b202250e927bc54e23cdccad8bf49fadc88d1964e057e76d
MISC metadata.xml 332 RMD160 b40e74088fb74ddb66a5eda7f46bf63742e2258a SHA1 719e3d0e91af2df78aa7478990ef65c307fb0c31 SHA256 30e1f46e13b10bc59d15c29e986bf8d8aab98ce8338c33d6f37650f399ebb4b2
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.22-scripts-openrc.patch b/sys-cluster/vzctl/files/vzctl-3.0.22-scripts-openrc.patch
new file mode 100644
index 000000000000..77a305dfe3bc
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.22-scripts-openrc.patch
@@ -0,0 +1,237 @@
+--- etc/dists/scripts/gentoo-add_ip.sh 2008-09-16 14:25:00 +0000
++++ etc/dists/scripts/gentoo-add_ip.sh 2008-08-28 20:55:10 +0000
+@@ -16,7 +16,8 @@
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ #
+ #
+-# This script configure IP alias(es) inside Gentoo like VE.
++# This script configures IP alias(es) inside Gentoo based VE with
++# baselayout-1/openrc used as services/stratup/shutdown system.
+ #
+ # Parameters are passed in environment variables.
+ # Required parameters:
+@@ -29,40 +30,62 @@
+ #
+ VENET_DEV=venet0
+
+-
+-IFCFG_DIR=/etc/conf.d
+-IFCFG=${IFCFG_DIR}/net
++#IFCFG_DIR=/etc/conf.d
++IFCFG=/etc/conf.d/net
+
+ SCRIPT=/etc/runlevels/default/net.${VENET_DEV}
+
+ HOSTFILE=/etc/hosts
+
+-function fix_net()
++# Return true is we have openrc based VE and false if not.
++# Note: /etc/gentoo-release has nothing to do with openrc
++function is_openrc()
++{
++ [ -f /lib/librc.so ]
++}
++
++function comment_line_regex()
++{
++ cp -pf ${IFCFG} ${IFCFG}.$$ || \
++ error "Failed to comment ${1}: unable to copy ${IFCFG}" ${VZ_FS_NO_DISK_SPACE}
++ sed -e "s/${1}/#${1}/" < ${IFCFG} > ${IFCFG}.$$ && \
++ mv -f ${IFCFG}.$$ ${IFCFG} 2>/dev/null
++ if [ $? -ne 0 ]; then
++ rm -f ${IFCFG}.$$ 2>/dev/null
++ error "Failed to comment ${1}: unable to create ${IFCFG}."
++ fi
++}
++
++function set_config()
++{
++ if ! grep -qe "^config_eth" ${IFCFG} 2>/dev/null; then
++ comment_line_regex "^config_eth"
++ comment_line_regex "^routes_eth"
++ fi
++ if is_openrc ; then
++ put_param ${IFCFG} "config_${VENET_DEV}" ""
++ put_param ${IFCFG} "routes_${VENET_DEV}" "default"
++ else
++ put_param3 ${IFCFG} "config_${VENET_DEV}" ""
++ put_param3 ${IFCFG} "routes_${VENET_DEV}" \
++ "-net ${FAKEGATEWAYNET}/24" # dev ${VENET_DEV}
++ add_param3 ${IFCFG} "routes_${VENET_DEV}" "default via ${FAKEGATEWAY}"
++ fi
++}
++
++function set_rc()
+ {
+ [ -f "${SCRIPT}" ] && return 0
+ rc-update del net.eth0 &>/dev/null
++ rc-update add net.lo boot &>/dev/null
+ ln -sf /etc/init.d/net.lo /etc/init.d/net.${VENET_DEV}
+- rc-update add net.lo boot &>/dev/null
+ rc-update add net.${VENET_DEV} default &>/dev/null
+- if ! grep -qe "^config_eth" ${IFCFG} 2>/dev/null; then
+- return 0
+- fi
+- cp -pf ${IFCFG} ${IFCFG}.$$ || error "Unable to copy ${IFCFG}"
+- sed -e 's/^config_eth/#config_eth/' -e 's/^routes_eth/#routes_eth/' < ${IFCFG} > ${IFCFG}.$$ && mv -f ${IFCFG}.$$ ${IFCFG} 2>/dev/null
+- if [ $? -ne 0 ]; then
+- rm -f ${IFCFG}.$$ 2>/dev/null
+- error "Unable to create ${IFCFG}"
+- fi
+ }
+
+-function setup_network()
++function init_netconfig()
+ {
+- fix_net
+- put_param3 ${IFCFG} "config_${VENET_DEV}" ""
+- # add fake route
+- put_param3 ${IFCFG} "routes_${VENET_DEV}" \
+- "-net ${FAKEGATEWAYNET}/24" # dev ${VENET_DEV}
+- add_param3 ${IFCFG} "routes_${VENET_DEV}" "default via ${FAKEGATEWAY}"
++ set_rc
++ set_config
+ # Set up /etc/hosts
+ if [ ! -f ${HOSTFILE} ]; then
+ echo "127.0.0.1 localhost.localdomain localhost" > $HOSTFILE
+@@ -72,25 +95,27 @@
+ function add_ip()
+ {
+ local ip
+- local new_ips
+-
+- # In case we are starting VE
+- if [ "x${VE_STATE}" = "xstarting" ]; then
+- setup_network
+- fi
+-
+- if [ "x${IPDELALL}" = "xyes" ]; then
+- put_param3 "${IFCFG}" "config_${VENET_DEV}" ""
++ if [ "x${VE_STATE}" = "xstarting" -o "x${IPDELALL}" = "xyes" ]; then
++ init_netconfig
++ if [ "x${IPDELALL}" = "xyes" ]; then
++ /etc/init.d/net.${VENET_DEV} stop >/dev/null 2>&1
++ return 0
++ fi
+ fi
+
+ for ip in ${IP_ADDR}; do
+- grep -qw "^config_${VENET_DEV}=\(.*\"${ip}[\"\/].*\)" ${IFCFG} ||
+- add_param3 "${IFCFG}" "config_${VENET_DEV}" "${ip}/32"
++ if ! grep -qw "config_${VENET_DEV}=\(.*\"${ip}[\"\/].*\)" ${IFCFG}; then
++ if is_openrc ; then
++ add_param "${IFCFG}" "config_${VENET_DEV}" "${ip}/32"
++ else
++ add_param3 "${IFCFG}" "config_${VENET_DEV}" "${ip}/32"
++ fi
++ fi
+ done
+
+ if [ "x${VE_STATE}" = "xrunning" ]; then
+ # synchronyze config files & interfaces
+- /etc/init.d/net.${VENET_DEV} restart
++ /etc/init.d/net.${VENET_DEV} restart >/dev/null 2>&1
+ fi
+ }
+
+
+--- etc/dists/scripts/gentoo-del_ip.sh 2008-09-16 14:25:00 +0000
++++ etc/dists/scripts/gentoo-del_ip.sh 2008-08-28 20:55:33 +0000
+@@ -28,19 +28,28 @@
+ VENET_DEV=venet0
+ CFGFILE=/etc/conf.d/net
+
+-# Function to delete IP address for Debian template
++# Return true is we have openrc based VE and false if not.
++# Note: /etc/gentoo-release has nothing to do with openrc
++function is_openrc()
++{
++ [ -f /lib/librc.so ]
++}
++
+ function del_ip()
+ {
+- local found=
+- local ip e_ip
+-
++ local ip
+ for ip in ${IP_ADDR}; do
+- grep -qw "${ip}" ${CFGFILE} && found=true &&
+- del_param3 "${CFGFILE}" "config_${VENET_DEV}" "${ip}/32"
++ if grep -qw "${ip}" ${CFGFILE}; then
++ if is_openrc ; then
++ del_param "${CFGFILE}" "config_${VENET_DEV}" "${ip}/32"
++ else
++ del_param3 "${CFGFILE}" "config_${VENET_DEV}" "${ip}/32"
++ fi
++ if [ "x${VE_STATE}" = "xrunning" ]; then
++ /etc/init.d/net.${VENET_DEV} restart >/dev/null 2>&1
++ fi
++ fi
+ done
+- if [ -n "${found}" ]; then
+- /etc/init.d/net.${VENET_DEV} restart 2>/dev/null 1>/dev/null
+- fi
+ }
+
+ del_ip
+
+--- etc/dists/scripts/gentoo-set_hostname.sh 2008-09-16 14:25:00 +0000
++++ etc/dists/scripts/gentoo-set_hostname.sh 2008-08-24 07:47:46 +0000
+@@ -16,22 +16,39 @@
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ #
+ #
+-# This script sets hostname inside VE for Gentoo like distros
+-# For usage info see vz-veconfig(5) man page.
++# This script sets hostname inside Gentoo based VE with
++# baselayout-1/openrc used as services/stratup/shutdown system.
+ #
+ # Some parameters are passed in environment variables.
+ # Required parameters:
+ # Optional parameters:
+ # HOSTNM
+-# Sets host name for this VE. Modifies /etc/hosts and
+-# /etc/sysconfig/network (in RedHat) or /etc/rc.config (in SuSE)
++# Sets host name for this VE. Modifies /etc/conf.d/hostname
++
++# Return true is we have openrc based VE and false if not.
++# Note: /etc/gentoo-release has nothing to do with openrc
++function is_openrc()
++{
++ [ -f /lib/librc.so ]
++}
++
+ function set_hostname()
+ {
+ local cfgfile=$1
+ local hostname=$2
+
+ [ -z "${hostname}" ] && return 0
+- put_param "${cfgfile}" "HOSTNAME" "${hostname}"
++ if is_openrc ; then
++ if grep -qe "^HOSTNAME=" ${cfgfile} >/dev/null 2>&1; then
++ del_param ${cfgfile} "HOSTNAME"
++ fi
++ put_param "${cfgfile}" "hostname" "${hostname}"
++ else
++ if grep -qe "^hostname=" ${cfgfile} >/dev/null 2>&1; then
++ del_param ${cfgfile} "hostname"
++ fi
++ put_param "${cfgfile}" "HOSTNAME" "${hostname}"
++ fi
+ hostname ${hostname}
+ }
+
+
+--- etc/dists/scripts/gentoo-set_ugid_quota.sh 2008-09-16 14:25:00 +0000
++++ etc/dists/scripts/gentoo-set_ugid_quota.sh 2008-08-28 21:40:00 +0000
+@@ -57,6 +57,6 @@
+ }
+ chmod 755 ${SCRIPTANAME}
+
+-ln -sf ${SCRIPTANAME} ${DEFAULT}
++rc-update add vzquota default
+
+ exit 0
+
diff --git a/sys-cluster/vzctl/vzctl-3.0.22-r10.ebuild b/sys-cluster/vzctl/vzctl-3.0.22-r10.ebuild
new file mode 100644
index 000000000000..f9cf8084db47
--- /dev/null
+++ b/sys-cluster/vzctl/vzctl-3.0.22-r10.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-3.0.22-r10.ebuild,v 1.1 2008/10/13 09:25:59 pva Exp $
+
+inherit bash-completion eutils
+
+DESCRIPTION="OpenVZ VE control utility"
+HOMEPAGE="http://openvz.org/"
+SRC_URI="http://download.openvz.org/utils/${PN}/${PV}/src/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ia64 ~ppc64 ~sparc ~x86"
+IUSE="bash-completion logrotate"
+
+RDEPEND="logrotate? ( app-admin/logrotate )
+ net-firewall/iptables
+ sys-apps/ed
+ sys-apps/iproute2
+ sys-fs/vzquota
+ virtual/cron"
+
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${P}-capability-fix.patch
+ epatch "${FILESDIR}"/${P}-glibc28.patch
+ epatch "${FILESDIR}"/${P}-document-disable-modules.patch
+ epatch "${FILESDIR}"/${P}-workaround-gentoo-add_ip.patch
+ epatch "${FILESDIR}"/${P}-scripts-openrc.patch
+}
+
+src_compile() {
+ econf --localstatedir=/var \
+ --enable-cron \
+ --enable-udev \
+ $(use_enable bash-completion bashcomp) \
+ $(use_enable logrotate)
+
+ emake || die "emake failed!"
+}
+
+src_install() {
+ make DESTDIR="${D}" install install-gentoo || die "make install failed"
+
+ # install the bash-completion script into the right location
+ rm -rf "${D}"/etc/bash_completion.d
+ dobashcompletion "${S}"/etc/bash_completion.d/vzctl.sh vzctl
+
+ # We need to keep some dirs
+ keepdir /vz/{dump,lock,root,private,template/cache}
+ keepdir /etc/vz/names /var/lib/vzctl/veip
+}
+
+pkg_postinst() {
+ bash-completion_pkg_postinst
+ ewarn
+ if has_version "<sys-cluster/vzctl-3.0.10"; then
+ ewarn "The location of some vzctl files have changed. Most notably,"
+ ewarn "VE configuration files and samples directory has changed from"
+ ewarn "/etc/vz to /etc/vz/conf. In order to be able to work with"
+ ewarn "your VEs, please do the following:"
+ ewarn
+ ewarn "bash# mv /etc/vz/[0-9]*.conf /etc/vz/conf/"
+ ewarn
+ fi
+ ewarn "NOTE: Starting with vzctl-3.0.22 the mechanism for choosing the"
+ ewarn "interfaces to send ARP requests to has been improved (see description"
+ ewarn "of NEIGHBOUR_DEVS in vz.conf(5) man page). In case VE IP addresses"
+ ewarn "are not on the same subnet as HN IPs, it may lead to such VEs being"
+ ewarn "unreachable from the outside world."
+ ewarn
+ ewarn "The solution is to set up a device route(s) for the network your VEs are"
+ ewarn "in. For more details, see http://bugzilla.openvz.org/show_bug.cgi?id=771#c1"
+ ewarn
+ ewarn "The old vzctl behavior can be restored by setting NEIGHBOUR_DEVS to any"
+ ewarn 'value other than "detect" in /etc/vz/vz.conf.'
+}