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
commite37158e90b4ee51b83d87ba522417f88261e5dc6 (patch)
treece334b190aad06ab67d6af86a3bf70c1311a7b19 /sys-cluster
parentStable on ppc64; bug #246602 (diff)
downloadgentoo-2-e37158e90b4ee51b83d87ba522417f88261e5dc6.tar.gz
gentoo-2-e37158e90b4ee51b83d87ba522417f88261e5dc6.tar.bz2
gentoo-2-e37158e90b4ee51b83d87ba522417f88261e5dc6.zip
Version bump.
(Portage version: 2.2_rc14/cvs/Linux 2.6.26-openvz.git-35f41f1 i686)
Diffstat (limited to 'sys-cluster')
-rw-r--r--sys-cluster/vzctl/ChangeLog12
-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
7 files changed, 305 insertions, 494 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/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."
}