summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2008-11-15 13:01:31 +0000
committerPeter Volkov <pva@gentoo.org>2008-11-15 13:01:31 +0000
commitc9a8410665310ac965aa4e0fa7ac632bd047043d (patch)
tree955a7c7dd2b4cf3680041680d66d40ec1308484d /sys-cluster/vzctl
parentStable on ppc64; bug #246602 (diff)
downloadhistorical-c9a8410665310ac965aa4e0fa7ac632bd047043d.tar.gz
historical-c9a8410665310ac965aa4e0fa7ac632bd047043d.tar.bz2
historical-c9a8410665310ac965aa4e0fa7ac632bd047043d.zip
Version bump.
Package-Manager: portage-2.2_rc14/cvs/Linux 2.6.26-openvz.git-35f41f1 i686
Diffstat (limited to 'sys-cluster/vzctl')
-rw-r--r--sys-cluster/vzctl/ChangeLog12
-rw-r--r--sys-cluster/vzctl/Manifest10
-rw-r--r--sys-cluster/vzctl/files/vz.initd245
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.22-scripts-openrc.patch237
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-ipforwarding-on-start.patch43
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-set-cron-jobs.patch53
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-ve-unlimited.conf-sample.patch178
-rw-r--r--sys-cluster/vzctl/vzctl-3.0.23.ebuild (renamed from sys-cluster/vzctl/vzctl-3.0.22-r11.ebuild)31
8 files changed, 311 insertions, 498 deletions
diff --git a/sys-cluster/vzctl/ChangeLog b/sys-cluster/vzctl/ChangeLog
index 2ab34c652df0..15ce3df58951 100644
--- a/sys-cluster/vzctl/ChangeLog
+++ b/sys-cluster/vzctl/ChangeLog
@@ -1,6 +1,16 @@
# 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.59 2008/11/08 19:41:59 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/ChangeLog,v 1.60 2008/11/15 13:01:30 pva Exp $
+
+*vzctl-3.0.23 (15 Nov 2008)
+
+ 15 Nov 2008; Peter Volkov <pva@gentoo.org>
+ -files/vzctl-3.0.22-scripts-openrc.patch,
+ +files/vzctl-3.0.23-ipforwarding-on-start.patch,
+ +files/vzctl-3.0.23-set-cron-jobs.patch,
+ +files/vzctl-3.0.23-ve-unlimited.conf-sample.patch, -files/vz.initd,
+ -vzctl-3.0.22-r11.ebuild, +vzctl-3.0.23.ebuild:
+ Version bump.
*vzctl-3.0.22-r11 (08 Nov 2008)
*vzctl-3.0.22-r2 (08 Nov 2008)
diff --git a/sys-cluster/vzctl/Manifest b/sys-cluster/vzctl/Manifest
index c01a9bcb9dbe..49d2cdccb27e 100644
--- a/sys-cluster/vzctl/Manifest
+++ b/sys-cluster/vzctl/Manifest
@@ -1,13 +1,15 @@
-AUX vz.initd 5465 RMD160 303e4877e95db9f90d512b37d67cdaa94e823d52 SHA1 967cc1a9d71109db574f565d2f733332cfafcf50 SHA256 63c17d2783cfd01fcfb66aa8b0c572ea6bf366d59a72c10f1728091c7eaa5fc0
AUX vzctl-3.0.22-adjust-meminfo.patch 1521 RMD160 e414657c8dc723b254b86dc05f80bf505fe847e2 SHA1 caae359fff43efdaa54cc29810adfbbcb2fac922 SHA256 65e1536a7695b2387d9b228882bcb436490a668301e4b590104deac78d2b34d3
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
+AUX vzctl-3.0.23-ipforwarding-on-start.patch 1274 RMD160 51a5b0ffb9fccfa275059a9a1f9515f5ac4b2669 SHA1 d7c931858c84202ede88f7e07e36cfa0ad579dcd SHA256 5404038ce614ec224ec5c634559e250d5020c91b056c445814664e64ff3c6f45
+AUX vzctl-3.0.23-set-cron-jobs.patch 1919 RMD160 1fb8adb60ab7503444d1f0b3f4625828d10dafd9 SHA1 538273d8982018426e78ec491f2ce50846bdf13c SHA256 e2634efc003d0f6dd614758e3f0dc28d934dc512c4101e89c7c74686b559f400
+AUX vzctl-3.0.23-ve-unlimited.conf-sample.patch 7093 RMD160 b593112e798280c45c4fdaf04e17b05e16842798 SHA1 62707930776226ba5676b2e38e6f711881bfa068 SHA256 bad86e985fd7cb81261dd69a44b7c2618d6fca1f967228f9157658fea62a1207
DIST vzctl-3.0.22.tar.bz2 360012 RMD160 53353981fefea94d997b3555600583f4c5818833 SHA1 58e5c55855aebf9e4ca032b325d8960a3836d648 SHA256 20f75e8342b85909d6bf01d0db47acaa088125da7f203b5e6e6169aa4c139166
+DIST vzctl-3.0.23.tar.bz2 361403 RMD160 6436843d4d7de8c98de3ec57c8003e3b625529ef SHA1 b94545dd5608bb48389abcb93e3fc8c91141461a SHA256 3ca7da609ee07b0a8d6b21f05c76b35ba8febc6b5c251b67c759bcbb3bf76eea
EBUILD vzctl-3.0.22-r1.ebuild 2585 RMD160 3a26d40c46dc4e7052184eaf9fb7f96bb1cbdf76 SHA1 0e673748b748658799e7e4646c789e73fc44161f SHA256 be918b625ea4a3c411402f596a04939912e82c6de1a173fb9f86180fc08e9b73
-EBUILD vzctl-3.0.22-r11.ebuild 2661 RMD160 b5b9afe96676dcd0e406910b3a547eb5908f7d3f SHA1 047e04ce8d7b2011a5d809e0c1e8e04fcc4a66a6 SHA256 61c5c872b5d888ca08574abe5c6c90bf27f81fd63bc3535545352b1c1aed3c10
EBUILD vzctl-3.0.22-r2.ebuild 2635 RMD160 1af38bcd6d72c810e7114a957a49fc9c71c9d2ce SHA1 4569beda0805201dc597bb1376549dfd3977091c SHA256 2a1fe5bc22628b4063c287aa7adb1f7633da0f84989337e73fc15de6613897f8
-MISC ChangeLog 11556 RMD160 630eefa6904aa030c95fb3c694988163d7c9f000 SHA1 552fdafe40d6fef1ffccd34127c0fc0f6a229880 SHA256 780f38196a6fa9883cb7b62982834bf8208a9e6306fc90e2ef00f1060a61cdd8
+EBUILD vzctl-3.0.23.ebuild 3081 RMD160 6a0c36ce327b32fc4a5057646ff8ede1041b0ea4 SHA1 747251a6aafe2aec487ce4ab5a49ed1f567a7703 SHA256 bf6484d3531fc1cf5f5af30d608e405f0d409a0fb19acb637322a673f629edac
+MISC ChangeLog 11906 RMD160 c7a0aa74b91c19abdd69be545c5411c60e20cb86 SHA1 e106364ec827b15745bb63eefb66a1ee55d3f64f SHA256 319754b9fb0bb7fe523df038b4221dfe4552b433ff64c86a97c3e711bf0a561b
MISC metadata.xml 332 RMD160 b40e74088fb74ddb66a5eda7f46bf63742e2258a SHA1 719e3d0e91af2df78aa7478990ef65c307fb0c31 SHA256 30e1f46e13b10bc59d15c29e986bf8d8aab98ce8338c33d6f37650f399ebb4b2
diff --git a/sys-cluster/vzctl/files/vz.initd b/sys-cluster/vzctl/files/vz.initd
deleted file mode 100644
index 665be642cc9f..000000000000
--- a/sys-cluster/vzctl/files/vz.initd
+++ /dev/null
@@ -1,245 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/files/vz.initd,v 1.1 2005/09/26 15:32:35 hollow Exp $
-
-depend() {
- need net
- before iptables
-}
-
-check_config() {
- # if we don't want openvz running, say so
- [ "${VIRTUOZZO}" = "yes" ] || return 1
-
- # set default values
- : ${VZCTL:=/usr/sbin/vzctl}
- : ${VZQUOTA:=/usr/sbin/vzquota}
- : ${VZVEINFO:=/proc/vz/veinfo}
- : ${VPSCONFDIR:=/etc/vz}
- : ${PRELOAD_MODULES:="af_packet"}
- : ${MODULES:="vzmon vzdquota vzdev"}
- : ${NET_MODULES="vznetdev vznet"}
- : ${VZDEV:=venet0}
- : ${PARALLEL:=4}
-
- # check if you should load vzwdog module
- [ "${VZWDOG}" = "yes" ] && MODULES="${MODULES} vzwdog"
-
- # we need a working vzctl
- if [ ! -x "${VZCTL}" ]; then
- eerror "vzctl missing (${VZCTL})"
- return 1
- fi
-
- # prevent dumb users from failure
- if [ ! -e /dev/vzctl ]; then
- eerror "Missing device node /dev/vzctl"
- einfo
- einfo "Please create the vzctl device node using the following command:"
- einfo " /bin/mknod /dev/vzctl c 126 0"
- einfo
- return 1
- fi
-
- if [ -z "${VE0CPUUNITS}" ]; then
- ewarn "VE0CPUUNITS is not set in /etc/conf.d/vz; using default value of 1000"
- VE0CPUUNITS=1000
- fi
- return 0
-}
-
-start_net() {
- local mod
-
- # we don't operate on a running interface
- if /sbin/ip addr ls | grep -q "venet0:.*UP" 2>/dev/null; then
- return 0
- fi
-
- # load necessary modules
- for mod in ${NET_MODULES}; do
- /sbin/modprobe ${mod} 2>/dev/null
- done
-
- # configure the device
- ebegin "Bringing up interface ${VZDEV}"
- /sbin/ip link set ${VZDEV} up
- eend $?
-
- /sbin/ip addr add 0.0.0.0/0 dev ${VZDEV}
-
- ebegin "Configuring interface ${VZDEV}"
- /sbin/sysctl -q -w net.ipv4.conf.${VZDEV}.send_redirects=0
- eend $?
-}
-
-stop_net() {
- local mod
-
- if /sbin/ip a l | grep -q "venet0:.*UP" 2>/dev/null; then
- ebegin "Bringing down interface ${VZDEV}"
- /sbin/ip link set ${VZDEV} down 2>/dev/null
- eend $?
- fi
-
- # remove all modules we probably loaded on start_net
- for mod in ${NET_MODULES}; do
- /sbin/modprobe -r ${mod} > /dev/null 2>&1
- done
-}
-
-start_ve() {
- local veid velist msg need_restart=""
-
- # get all VPSs we should start on boot
- if ! cd ${VPSCONFDIR}; then
- eerror $? "Unable to cd to ${VPSCONFDIR}"
- return 1
- fi
- velist=$(grep -l '^ONBOOT=yes\|^ONBOOT=\"yes\"' [0-9]*.conf 2>/dev/null | sed -e 's/.conf//g' | sort -n)
- cd - >/dev/null
-
- /sbin/sysctl -q -w net.ipv4.route.src_check=0
-
- for veid in ${velist}; do
- ebegin "Starting VPS ${veid}"
- if [ "${VZFASTBOOT}" = "yes" -a "${DISK_QUOTA}" = "yes" ]; then
- ${VZQUOTA} stat ${veid} >/dev/null 2>&1
- if [ $? -eq 6 ]; then
- if ${VZQUOTA} show ${veid} 2>&1 | grep "vzquota : (warning) Quota is running" >/dev/null 2>&1; then
- ${VZQUOTA} on ${veid} --nocheck >/dev/null 2>&1
- need_restart="${need_restart} ${veid}"
- fi
- fi
- fi
- msg=$(${VZCTL} start ${veid} 2>&1)
- eend $? "${msg}"
- done
-
- for veid in ${need_restart}; do
- ebegin "Stopping VPS ${veid}"
- msg=$(${VZCTL} stop ${veid})
- eend $? "${msg}"
-
- ebegin "Starting VPS ${veid}"
- msg=$($VZCTL start ${veid} 2>&1)
- eend $? "${msg}"
- done
-
- # we're ok even if some VPSs failed to start
- return 0
-}
-
-stop_ve() {
- local veid velist msg m mounts fail i iter pid pids quota
-
- if [ -f ${VZVEINFO} ]; then
- for ((i = 0; i <= 2; i++)); do
- iter=0
- pids=
- velist=$(awk '{print $1;}' < ${VZVEINFO} | grep -v "^0$")
-
- for veid in ${velist}; do
- ebegin "Shutting down VPS $veid"
- # Set fairsched parameters to maximum so
- # VPS will stop fast
- ${VZCTL} set ${veid} --cpuunits 2000 --cpulimit 0 >/dev/null 2>&1
- ${VZCTL} --skiplock stop ${veid} >/dev/null 2>&1 &
- pids="${pids} $!"
- let iter++
- sleep 1
- if [ ${iter} -gt ${PARALLEL} ]; then
- for pid in ${pids}; do
- wait ${pid}
- done
- pids=
- iter=0
- fi
- done
-
- for pid in ${pids}; do
- wait ${pid}
- done
- done
- fi
-
- iter=0
- fail=1
-
- while [ ${iter} -lt 5 -a ${fail} -ne 0 ]; do
- fail=0
- mounts=$(awk '{if ($3=="simfs") print $2}' /proc/mounts)
-
- for m in ${mounts}; do
- ebegin "Unmounting VPS area ${m}"
- msg=$(umount ${m} 2>&1)
- eend $? "${msg}"
- if [ $? -ne 0 ]; then
- let fail++
- fuser -k -m ${m} > /dev/null 2>&1
- fi
- done
-
- let iter++
- done
-
- # turn quota off
- quota=$(awk -F: '/^[0-9]+:/{print $1}' /proc/vz/vzquota 2>/dev/null)
-
- for m in ${quota}; do
- ebegin "Turning quota off for VPS ${m}"
- msg=$(vzquota off ${m} 2>&1)
- eend $? "${msg}"
- done
-}
-
-start() {
- check_config || return
-
- local msg mod rc
-
- ebegin "Loading OpenVZ modules"
- for mod in ${PRELOAD_MODULES}; do
- /sbin/modprobe -r ${mod} >/dev/null 2>&1
- /sbin/modprobe ${mod} >/dev/null 2>&1
- done
-
- for mod in ${MODULES}; do
- /sbin/modprobe ${mod} >/dev/null 2>&1
- rc=$?
- if [ ${rc} -ne 0 ]; then
- eend ${rc} "failed to load module ${mod}"
- return ${rc}
- fi
- done
- eend
-
- start_net
-
- msg=$(${VZCTL} set 0 --cpuunits ${VE0CPUUNITS} 2>&1)
- [ $? -ne 0 ] && ewarn "vzctl set 0 --cpuunits ${VE0CPUUNITS} failed: ${msg}"
-
- start_ve
-}
-
-stop() {
- check_config || return
-
- local mod
-
- stop_ve
- stop_net
-
- for mod in ${MODULES}; do
- /sbin/modprobe -r ${mod} > /dev/null 2>&1
- done
-
- for mod in ${PRELOAD_MODULES}; do
- /sbin/modprobe -r ${mod} > /dev/null 2>&1
- done
-
- # Even if some modules failed to unload (say they were not loaded)
- # we return 0 for the service to be marked as stopped.
- return 0
-}
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
deleted file mode 100644
index 77a305dfe3bc..000000000000
--- a/sys-cluster/vzctl/files/vzctl-3.0.22-scripts-openrc.patch
+++ /dev/null
@@ -1,237 +0,0 @@
---- 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/files/vzctl-3.0.23-ipforwarding-on-start.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-ipforwarding-on-start.patch
new file mode 100644
index 000000000000..b07a5b301b62
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-ipforwarding-on-start.patch
@@ -0,0 +1,43 @@
+=== modified file 'etc/init.d/vz-gentoo.in'
+--- etc/init.d/vz-gentoo.in 2008-11-15 09:57:13 +0000
++++ etc/init.d/vz-gentoo.in 2008-11-15 11:35:03 +0000
+@@ -116,6 +116,11 @@
+ ebegin "Configuring interface ${VZDEV}"
+ /sbin/sysctl -q -w net.ipv4.conf.${VZDEV}.send_redirects=0
+ eend $?
++ if [ "${ENABLE_FORWARDING}" = "yes" ]; then
++ ebegin "Enabling system wide forwading (\$ENABLE_FORWARDING is set to yes)..."
++ sysctl -w "net.ipv4.ip_forward=1"
++ eend $?
++ fi
+ }
+
+ stop_net() {
+@@ -131,6 +136,11 @@
+ for mod in ${NET_MODULES}; do
+ /sbin/modprobe -r ${mod} > /dev/null 2>&1
+ done
++ if [ "${ENABLE_FORWARDING}" = "yes" ]; then
++ ebegin "Disabling system wide forwading (\$ENABLE_FORWARDING is set to yes)..."
++ sysctl -w "net.ipv4.ip_forward=0"
++ eend $?
++ fi
+ }
+
+ start_ve() {
+
+=== modified file 'etc/vz.conf'
+--- etc/vz.conf 2008-11-15 09:57:13 +0000
++++ etc/vz.conf 2008-11-15 09:58:22 +0000
+@@ -21,6 +21,10 @@
+ # By default automatically assigned.
+ #VE_ROUTE_SRC_DEV="eth0"
+
++# Uncomment to enable forwarding automatically during /etc/init.d/vz start
++# (Calls sysctl -w "net.ipv4.ip_forward=1" on start and revert on stop)
++#ENABLE_FORWARDING="yes"
++
+ # Controls which interfaces to send ARP requests and modify APR tables on.
+ NEIGHBOUR_DEVS=detect
+
+
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.23-set-cron-jobs.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-set-cron-jobs.patch
new file mode 100644
index 000000000000..eacf6a05db98
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-set-cron-jobs.patch
@@ -0,0 +1,53 @@
+=== modified file 'etc/init.d/vz-gentoo.in'
+--- etc/init.d/vz-gentoo.in 2008-11-15 11:39:55 +0000
++++ etc/init.d/vz-gentoo.in 2008-11-15 12:28:43 +0000
+@@ -56,17 +56,29 @@
+ # being enabled or not.
+ setup_cron()
+ {
+- [ -z "$SRC_CRONSCRIPT_DIR" ] && return
+- [ -d "$SRC_CRONSCRIPT_DIR" ] || return
+- install -m644 -o root -g root $SRC_CRONSCRIPT_DIR/vz \
+- $DST_CRONSCRIPT_DIR
++ [ -z "${SRC_CRONSCRIPT_DIR}" ] && return
++ if [ ! -d "${DST_CRONSCRIPT_DIR}" ]; then
++ if [ "${SKIP_CRON_WARNINGS}" == "no" ]; then
++ ewarn "Automatic setup of cron jobs works only if a system cron daemon can use"
++ ewarn "\${DST_CRONSCRIPT_DIR} (${DST_CRONSCRIPT_DIR}) as a spool directory"
++ ewarn "(e.g. sys-process/vixie-cron can). On your system ${DST_CRONSCRIPT_DIR}"
++ ewarn "is even not a directory, thus set the following cron jobs, please:"
++ ewarn "*/5 * * * * root /usr/share/vzctl/scripts/vpsnetclean"
++ ewarn "*/5 * * * * root /usr/share/vzctl/scripts/vpsreboot"
++ ewarn "If you already did that and wish to avoid this warning edit /etc/conf.d/vz"
++ ewarn "and either comment SKIP_CRON_WARNINGS variable or set its value to yes."
++ fi
++ return
++ fi
++ install -m644 -o root -g root $SRC_CRONSCRIPT_DIR/vz \
++ ${DST_CRONSCRIPT_DIR}
+ }
+
+ remove_cron()
+ {
+- [ -z "$SRC_CRONSCRIPT_DIR" ] && return
+- [ -d "$SRC_CRONSCRIPT_DIR" ] || return
+- cat > $DST_CRONSCRIPT_DIR/vz <<EOF
++ [ -z "${SRC_CRONSCRIPT_DIR}" ] && return
++ [ -d "${DST_CRONSCRIPT_DIR}" ] || return
++ cat > ${DST_CRONSCRIPT_DIR}/vz <<EOF
+ # DO NOT EDIT THIS FILE!
+ #
+ # Contents of this file managed by /etc/init.d/vz script
+
+=== modified file 'etc/vz.conf'
+--- etc/vz.conf 2008-11-15 11:39:55 +0000
++++ etc/vz.conf 2008-11-15 12:10:13 +0000
+@@ -9,6 +9,7 @@
+ LOGFILE=/var/log/vzctl.log
+ LOG_LEVEL=0
+ VERBOSE=0
++SKIP_CRON_WARNINGS=no
+
+ ## Disk quota parameters
+ DISK_QUOTA=yes
+
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.23-ve-unlimited.conf-sample.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-ve-unlimited.conf-sample.patch
new file mode 100644
index 000000000000..1a4761a716db
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-ve-unlimited.conf-sample.patch
@@ -0,0 +1,178 @@
+=== modified file 'etc/conf/Makefile.am'
+--- etc/conf/Makefile.am 2008-11-15 09:57:13 +0000
++++ etc/conf/Makefile.am 2008-11-15 10:44:26 +0000
+@@ -18,7 +18,7 @@
+ include $(top_srcdir)/paths.am
+
+ VE0CONFIG = 0.conf
+-VECONFIG = ve-light.conf-sample ve-vps.basic.conf-sample
++VECONFIG = ve-light.conf-sample ve-vps.basic.conf-sample ve-unlimited.conf-sample
+
+ if ARCH_IA64
+ VECONFIG_EXT = .ia64
+
+=== added file 'etc/conf/ve-unlimited.conf-sample.ia64'
+--- etc/conf/ve-unlimited.conf-sample.ia64 1970-01-01 00:00:00 +0000
++++ etc/conf/ve-unlimited.conf-sample.ia64 2008-11-15 10:43:49 +0000
+@@ -0,0 +1,50 @@
++# Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++#
++
++VERSION="2"
++
++ONBOOT="no"
++
++# UBC parameters (in form of barrier:limit)
++# Primary parameters
++AVNUMPROC="9223372036854775807:9223372036854775807"
++NUMPROC="9223372036854775807:9223372036854775807"
++NUMTCPSOCK="9223372036854775807:9223372036854775807"
++NUMOTHERSOCK="9223372036854775807:9223372036854775807"
++VMGUARPAGES="9223372036854775807:9223372036854775807"
++# Secondary parameters
++KMEMSIZE="9223372036854775807:9223372036854775807"
++TCPSNDBUF="9223372036854775807:9223372036854775807"
++TCPRCVBUF="9223372036854775807:9223372036854775807"
++OTHERSOCKBUF="9223372036854775807:9223372036854775807"
++DGRAMRCVBUF="9223372036854775807:9223372036854775807"
++OOMGUARPAGES="9223372036854775807:9223372036854775807"
++# Auxiliary parameters
++LOCKEDPAGES="9223372036854775807:9223372036854775807"
++SHMPAGES="9223372036854775807:9223372036854775807"
++PRIVVMPAGES="9223372036854775807:9223372036854775807"
++NUMFILE="9223372036854775807:9223372036854775807"
++NUMFLOCK="9223372036854775807:9223372036854775807"
++NUMPTY="9223372036854775807:9223372036854775807"
++NUMSIGINFO="9223372036854775807:9223372036854775807"
++DCACHESIZE="9223372036854775807:9223372036854775807"
++
++PHYSPAGES="9223372036854775807:9223372036854775807"
++NUMIPTENT="9223372036854775807:9223372036854775807"
++
++# Disk quota parameters (in form of softlimit:hardlimit)
++DISK_QUOTA="no"
+
+=== added file 'etc/conf/ve-unlimited.conf-sample.x86'
+--- etc/conf/ve-unlimited.conf-sample.x86 1970-01-01 00:00:00 +0000
++++ etc/conf/ve-unlimited.conf-sample.x86 2008-11-15 10:43:15 +0000
+@@ -0,0 +1,50 @@
++# Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++#
++
++VERSION="2"
++
++ONBOOT="no"
++
++# UBC parameters (in form of barrier:limit)
++# Primary parameters
++AVNUMPROC="2147483647:2147483647"
++NUMPROC="2147483647:2147483647"
++NUMTCPSOCK="2147483647:2147483647"
++NUMOTHERSOCK="2147483647:2147483647"
++VMGUARPAGES="2147483647:2147483647"
++# Secondary parameters
++KMEMSIZE="2147483647:2147483647"
++TCPSNDBUF="2147483647:2147483647"
++TCPRCVBUF="2147483647:2147483647"
++OTHERSOCKBUF="2147483647:2147483647"
++DGRAMRCVBUF="2147483647:2147483647"
++OOMGUARPAGES="2147483647:2147483647"
++# Auxiliary parameters
++LOCKEDPAGES="2147483647:2147483647"
++SHMPAGES="2147483647:2147483647"
++PRIVVMPAGES="2147483647:2147483647"
++NUMFILE="2147483647:2147483647"
++NUMFLOCK="2147483647:2147483647"
++NUMPTY="2147483647:2147483647"
++NUMSIGINFO="2147483647:2147483647"
++DCACHESIZE="2147483647:2147483647"
++
++PHYSPAGES="2147483647:2147483647"
++NUMIPTENT="2147483647:2147483647"
++
++# Disk quota parameters (in form of softlimit:hardlimit)
++DISK_QUOTA="no"
+
+=== added file 'etc/conf/ve-unlimited.conf-sample.x86_64'
+--- etc/conf/ve-unlimited.conf-sample.x86_64 1970-01-01 00:00:00 +0000
++++ etc/conf/ve-unlimited.conf-sample.x86_64 2008-11-15 10:43:59 +0000
+@@ -0,0 +1,50 @@
++# Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++#
++
++VERSION="2"
++
++ONBOOT="no"
++
++# UBC parameters (in form of barrier:limit)
++# Primary parameters
++AVNUMPROC="9223372036854775807:9223372036854775807"
++NUMPROC="9223372036854775807:9223372036854775807"
++NUMTCPSOCK="9223372036854775807:9223372036854775807"
++NUMOTHERSOCK="9223372036854775807:9223372036854775807"
++VMGUARPAGES="9223372036854775807:9223372036854775807"
++# Secondary parameters
++KMEMSIZE="9223372036854775807:9223372036854775807"
++TCPSNDBUF="9223372036854775807:9223372036854775807"
++TCPRCVBUF="9223372036854775807:9223372036854775807"
++OTHERSOCKBUF="9223372036854775807:9223372036854775807"
++DGRAMRCVBUF="9223372036854775807:9223372036854775807"
++OOMGUARPAGES="9223372036854775807:9223372036854775807"
++# Auxiliary parameters
++LOCKEDPAGES="9223372036854775807:9223372036854775807"
++SHMPAGES="9223372036854775807:9223372036854775807"
++PRIVVMPAGES="9223372036854775807:9223372036854775807"
++NUMFILE="9223372036854775807:9223372036854775807"
++NUMFLOCK="9223372036854775807:9223372036854775807"
++NUMPTY="9223372036854775807:9223372036854775807"
++NUMSIGINFO="9223372036854775807:9223372036854775807"
++DCACHESIZE="9223372036854775807:9223372036854775807"
++
++PHYSPAGES="9223372036854775807:9223372036854775807"
++NUMIPTENT="9223372036854775807:9223372036854775807"
++
++# Disk quota parameters (in form of softlimit:hardlimit)
++DISK_QUOTA="no"
+
diff --git a/sys-cluster/vzctl/vzctl-3.0.22-r11.ebuild b/sys-cluster/vzctl/vzctl-3.0.23.ebuild
index 49f724ad81a1..5c6f2e2717ef 100644
--- a/sys-cluster/vzctl/vzctl-3.0.22-r11.ebuild
+++ b/sys-cluster/vzctl/vzctl-3.0.23.ebuild
@@ -1,8 +1,8 @@
# 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-r11.ebuild,v 1.1 2008/11/08 19:41:59 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-3.0.23.ebuild,v 1.1 2008/11/15 13:01:30 pva Exp $
-inherit bash-completion eutils
+inherit bash-completion eutils autotools
DESCRIPTION="OpenVZ VE control utility"
HOMEPAGE="http://openvz.org/"
@@ -22,16 +22,17 @@ RDEPEND="logrotate? ( app-admin/logrotate )
DEPEND="${RDEPEND}"
+pkg_setup() {
+ has_version "<sys-cluster/vzctl-3.0.10" && OLD_VZCTL=true || OLD_VZCTL=false
+}
+
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"
- epatch "${FILESDIR}/${P}-adjust-meminfo.patch"
+ epatch "${FILESDIR}/${P}-ipforwarding-on-start.patch"
+ epatch "${FILESDIR}/${P}-ve-unlimited.conf-sample.patch"
+ epatch "${FILESDIR}/${P}-set-cron-jobs.patch"
+ eautomake
}
src_compile() {
@@ -59,14 +60,14 @@ src_install() {
pkg_postinst() {
bash-completion_pkg_postinst
ewarn
- if has_version "<sys-cluster/vzctl-3.0.10"; then
+ if ${OLD_VZCTL}; 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
+ einfo
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"
@@ -79,4 +80,12 @@ pkg_postinst() {
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.'
+ einfo
+ ewarn "NOTE2: Starting with vzctl-3.0.22-r10 we support openrc inside VE."
+ ewarn "Regretfully openrc has bug which cause broken networking if you rely"
+ ewarn "on iputils to setup network inside container. To solve this issue"
+ ewarn "either install iproute2 inside container or use patch provided in:"
+ ewarn "http://bugs.gentoo.org/245810 . This patch will be included in"
+ ewarn ">=openrc-0.3.0-r1 so upgrading openrc (if available) fixes this"
+ ewarn "issue too."
}