summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2009-03-31 09:16:33 +0000
committerPeter Volkov <pva@gentoo.org>2009-03-31 09:16:33 +0000
commit87acf88671008a84d1367fa4ff6a564af15dd772 (patch)
tree49ad26cd30b9302d47648858e44f1edb2a968e79 /sys-cluster/vzctl
parentFix files/awk/fixlafiles.awk-no_gcc_la for POSIX shell compliant. (diff)
downloadgentoo-2-87acf88671008a84d1367fa4ff6a564af15dd772.tar.gz
gentoo-2-87acf88671008a84d1367fa4ff6a564af15dd772.tar.bz2
gentoo-2-87acf88671008a84d1367fa4ff6a564af15dd772.zip
Backport some fixes from git, update patches to be likely included (or already included) by upstream. Remove old. Stabilize 3.0.22-r2.
(Portage version: 2.2_rc28/cvs/Linux i686)
Diffstat (limited to 'sys-cluster/vzctl')
-rw-r--r--sys-cluster/vzctl/ChangeLog22
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-UBC-parameter-swappages.patch170
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-issue-warning.patch36
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-typo-fix.patch38
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-debian-CT-ipv6-fix.patch24
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-forwarding-issue-warning.patch25
-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-ppp-feature.patch49
-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.patch191
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-vzarp-on-ifup.patch122
-rw-r--r--sys-cluster/vzctl/files/vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch92
-rw-r--r--sys-cluster/vzctl/vzctl-3.0.22-r2.ebuild6
-rw-r--r--sys-cluster/vzctl/vzctl-3.0.23-r1.ebuild (renamed from sys-cluster/vzctl/vzctl-3.0.23.ebuild)22
14 files changed, 698 insertions, 195 deletions
diff --git a/sys-cluster/vzctl/ChangeLog b/sys-cluster/vzctl/ChangeLog
index 15ce3df58951..12b189b37a74 100644
--- a/sys-cluster/vzctl/ChangeLog
+++ b/sys-cluster/vzctl/ChangeLog
@@ -1,6 +1,24 @@
# 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.60 2008/11/15 13:01:30 pva Exp $
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/ChangeLog,v 1.61 2009/03/31 09:16:33 pva Exp $
+
+*vzctl-3.0.23-r1 (31 Mar 2009)
+
+ 31 Mar 2009; Peter Volkov <pva@gentoo.org>
+ +files/vzctl-3.0.23-UBC-parameter-swappages.patch,
+ +files/vzctl-3.0.23-cronjobs-issue-warning.patch,
+ +files/vzctl-3.0.23-cronjobs-typo-fix.patch,
+ +files/vzctl-3.0.23-debian-CT-ipv6-fix.patch,
+ +files/vzctl-3.0.23-forwarding-issue-warning.patch,
+ -files/vzctl-3.0.23-ipforwarding-on-start.patch,
+ +files/vzctl-3.0.23-ppp-feature.patch,
+ -files/vzctl-3.0.23-set-cron-jobs.patch,
+ files/vzctl-3.0.23-ve-unlimited.conf-sample.patch,
+ +files/vzctl-3.0.23-vzarp-on-ifup.patch,
+ +files/vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch,
+ vzctl-3.0.22-r2.ebuild, -vzctl-3.0.23.ebuild, +vzctl-3.0.23-r1.ebuild:
+ Backport some fixes from git, update patches to be likely included (or
+ already included) by upstream. Remove old. Stabilize 3.0.22-r2.
*vzctl-3.0.23 (15 Nov 2008)
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.23-UBC-parameter-swappages.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-UBC-parameter-swappages.patch
new file mode 100644
index 000000000000..6d89cba37fa3
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-UBC-parameter-swappages.patch
@@ -0,0 +1,170 @@
+From: Igor Sukhih <igor@openvz.org>
+Date: Tue, 10 Feb 2009 16:45:49 +0000 (+0300)
+Subject: Added new UBC parameter: swappages
+X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=6b819fb60634a109200b7a749aa40d595fcd4895
+
+Added new UBC parameter: swappages
+
+[kir@openvz.org: man page modifications]
+---
+
+diff --git a/include/ub.h b/include/ub.h
+index 35868aa..e6f0bf3 100644
+--- a/include/ub.h
++++ b/include/ub.h
+@@ -97,6 +97,9 @@
+ #ifndef UB_IPTENTRIES
+ #define UB_IPTENTRIES 23 /* Number of iptables rules */
+ #endif
++#ifndef UB_SWAPPAGES
++#define UB_SWAPPAGES 24
++#endif
+ #define UB_DUMMY 255
+
+ /** Data structure for UBC parameter.
+@@ -130,6 +133,7 @@ struct ub_struct {
+ unsigned long *dcachesize;
+ unsigned long *numiptent;
+ unsigned long *avnumproc;
++ unsigned long *swappages;
+ };
+ typedef struct ub_struct ub_param;
+
+diff --git a/include/vzctl_param.h b/include/vzctl_param.h
+index 83919e8..afb8898 100644
+--- a/include/vzctl_param.h
++++ b/include/vzctl_param.h
+@@ -134,6 +134,7 @@
+ #define PARAM_NETIF_MAC_FILTER 360
+ #define PARAM_NETIF_BRIDGE 361
+ #define PARAM_DESCRIPTION 362
++#define PARAM_SWAPPAGES 363
+
+ #define PARAM_LINE "e:p:f:t:i:l:k:a:b:n:x:h"
+ #endif
+diff --git a/man/vzctl.8 b/man/vzctl.8
+index 92d49e3..01c9d59 100644
+--- a/man/vzctl.8
++++ b/man/vzctl.8
+@@ -315,6 +315,15 @@ This is currently an accounting-only parameter. It shows the usage of RAM
+ by this container. Barrier should be set to 0, and limit should be set to
+ \fBunlimited\fR.
+ .TP
++\fB--swappages\fR \fIpages\fR[:\fIpages\fR]
++The limit, if set, is used to show a total amount of swap space available
++inside the container. The barrier of this parameter is currently ignored.
++The default value is \fBunlimited\fR, meaning total swap will be reported
++as 0.
++
++Note that in order for the value to be shown as total swap space,
++\fB--meminfo\fR parameter should be set to value other than \fBnone\fR.
++.TP
+ \fBCPU fair scheduler parameters\fR
+
+ These parameters control CPU usage by container.
+@@ -345,7 +354,8 @@ This parameter control output of /proc/meminfo inside a container
+ No /proc/meminfo virtualization (the same as on host system).
+ .IP "\fB--meminfo\fR \fImode\fR:\fIvalue\fR"
+ Configure total memory output in a container. Reported free memory is evaluated
+-accordingly to the mode being set.
++accordingly to the mode being set. Reported swap is evaluated
++according to the settings of \fB--swappages\fR parameter.
+ .br
+ You can use the following modes for \fImode\fR:
+ .br
+diff --git a/src/lib/config.c b/src/lib/config.c
+index bb8953f..a16fe54 100644
+--- a/src/lib/config.c
++++ b/src/lib/config.c
+@@ -83,6 +83,7 @@ static vps_config config[] = {
+ {"NUMIPTENT", NULL, PARAM_NUMIPTENT},
+ {"IPTENTRIES", "NUMIPTENT", -1},
+ {"AVNUMPROC", NULL, PARAM_AVNUMPROC},
++{"SWAPPAGES", NULL, PARAM_SWAPPAGES},
+ /* Capability */
+ {"CAPABILITY", NULL, PARAM_CAP},
+ /* Network */
+@@ -163,6 +164,7 @@ static struct option set_opt[] = {
+ {"dcachesize", required_argument, NULL, PARAM_DCACHESIZE},
+ {"numiptent", required_argument, NULL, PARAM_NUMIPTENT},
+ {"avnumproc", required_argument, NULL, PARAM_AVNUMPROC},
++{"swappages", required_argument, NULL, PARAM_SWAPPAGES},
+ /* Capability */
+ {"capability", required_argument, NULL, PARAM_CAP},
+ /* Network */
+@@ -685,6 +687,7 @@ if (ub->res != NULL) { \
+ ADD_UB_PARAM(dcachesize, PARAM_DCACHESIZE)
+ ADD_UB_PARAM(numiptent, PARAM_NUMIPTENT)
+ ADD_UB_PARAM(avnumproc, PARAM_AVNUMPROC)
++ ADD_UB_PARAM(swappages, PARAM_SWAPPAGES)
+ #undef ADD_UB_PARAM
+
+ return 0;
+@@ -1933,6 +1936,7 @@ static int parse(envid_t veid, vps_param *vps_p, char *val, int id)
+ case PARAM_PHYSPAGES:
+ case PARAM_VMGUARPAGES:
+ case PARAM_OOMGUARPAGES:
++ case PARAM_SWAPPAGES:
+ ret = parse_ub(vps_p, val, id, _page_size);
+ break;
+ case PARAM_NUMPROC:
+diff --git a/src/lib/ub.c b/src/lib/ub.c
+index a50a1dc..f25522f 100644
+--- a/src/lib/ub.c
++++ b/src/lib/ub.c
+@@ -61,6 +61,7 @@ static struct ubname2id {
+ {"DCACHESIZE", PARAM_DCACHESIZE},
+ {"NUMIPTENT", PARAM_NUMIPTENT},
+ {"AVNUMPROC", PARAM_AVNUMPROC},
++ {"SWAPPAGES", PARAM_SWAPPAGES},
+ {NULL, 0},
+ };
+
+@@ -128,6 +129,7 @@ inline static int is_ub_empty(ub_param *ub)
+ CHECK_UB(numfile)
+ CHECK_UB(dcachesize)
+ CHECK_UB(numiptent)
++ CHECK_UB(swappages)
+ #undef CHECK_UB
+
+ return 1;
+@@ -185,6 +187,16 @@ if (ub->name != NULL) { \
+ SET_UB_LIMIT(numfile, UB_NUMFILE)
+ SET_UB_LIMIT(dcachesize, UB_DCACHESIZE)
+ SET_UB_LIMIT(numiptent, UB_IPTENTRIES)
++ if (ub->swappages &&
++ setublimit(veid, UB_SWAPPAGES, ub->swappages) == -1)
++ {
++ if (errno == EINVAL) {
++ logger(-1, ENOSYS, "failed to set swappages");
++ } else {
++ logger(-1, errno, "failed to set swappages");
++ return VZ_SETUBC_ERROR;
++ }
++ }
+ #undef SET_UB_LIMIT
+
+ return 0;
+@@ -327,6 +339,7 @@ if ((src->x) != NULL) { \
+ MERGE_P2(dcachesize)
+ MERGE_P2(numiptent)
+ MERGE_P2(avnumproc)
++ MERGE_P2(swappages)
+ #undef MERGE_P2
+ }
+
+diff --git a/src/vzctl.c b/src/vzctl.c
+index 448b83a..58715ae 100644
+--- a/src/vzctl.c
++++ b/src/vzctl.c
+@@ -91,7 +91,9 @@ void usage(int rc)
+ " --oomguarpages P[:P] --lockedpages P[:P] --privvmpages P[:P]\n"
+ " --shmpages P[:P] --numfile N[:N] --numflock N[:N]\n"
+ " --numpty N[:N] --numsiginfo N[:N] --dcachesize N[:N]\n"
+-" --numiptent N[:N] --physpages P[:P] --avnumproc N[:N]\n");
++" --numiptent N[:N] --physpages P[:P] --avnumproc N[:N]\n"
++" --swappages P[:P]\n"
++);
+ memset(&mod, 0, sizeof(mod));
+ set_log_level(0);
+ init_modules(&mod, NULL);
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-issue-warning.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-issue-warning.patch
new file mode 100644
index 000000000000..5c9bd9225dae
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-issue-warning.patch
@@ -0,0 +1,36 @@
+commit 5f0d3dbcdb5f1f1f9d019619c4e3dd3b2f2d29f3
+Author: Peter Volkov <pva@gentoo.org>
+Date: Tue Mar 31 12:31:01 2009 +0400
+
+ Issue warning if cronjobs aren't automatically set
+
+ Init script is supposed to set cronjobs automatically on start and remove
+ them on stop. This works only with cron daemons that may hook at runtime
+ scripts at ${DST_CRONSCRIPT_DIR} (e.g. sys-process/vixie-cron can). For
+ other cron daemons it's safer to warn users to set cronjobs manually.
+
+diff --git a/etc/init.d/vz-gentoo.in b/etc/init.d/vz-gentoo.in
+index 97ea313..dc87d41 100755
+--- a/etc/init.d/vz-gentoo.in
++++ b/etc/init.d/vz-gentoo.in
+@@ -57,7 +57,19 @@ check_config() {
+ setup_cron()
+ {
+ [ -z "$SRC_CRONSCRIPT_DIR" ] && return
+- [ -d "$DST_CRONSCRIPT_DIR" ] || return
++ if [ ! -d "${DST_CRONSCRIPT_DIR}" ]; then
++ if [ "x${SKIP_CRON_WARNINGS}" != "xyes" ]; 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 not a directory even, thus you need manually set the following cron jobs:"
++ ewarn "*/5 * * * * root @PKGDATADIR@/scripts/vpsnetclean"
++ ewarn "*/5 * * * * root @PKGDATADIR@/scripts/vpsreboot"
++ ewarn "If you already did that and wish to avoid this warning put"
++ ewarn "SKIP_CRON_WARNINGS=yes into /etc/conf.d/vz."
++ fi
++ return
++ fi
+ install -m644 -o root -g root $SRC_CRONSCRIPT_DIR/vz \
+ $DST_CRONSCRIPT_DIR
+ }
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-typo-fix.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-typo-fix.patch
new file mode 100644
index 000000000000..038b7a21cde8
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-typo-fix.patch
@@ -0,0 +1,38 @@
+commit b57ce68fae2ce2642a36746b8e7b7216a02bfc8c
+Author: Peter Volkov <pva@gentoo.org>
+Date: Sun Feb 22 19:40:34 2009 +0300
+
+ vz-gentoo.in typo: check for DST_CRONSCRIPT_DIR
+
+ Fixed indentation and typo to make script really check for
+ $DST_CRONSCRIPT_DIR directory existence.
+
+diff --git a/etc/init.d/vz-gentoo.in b/etc/init.d/vz-gentoo.in
+index 005813f..97ea313 100755
+--- a/etc/init.d/vz-gentoo.in
++++ b/etc/init.d/vz-gentoo.in
+@@ -56,17 +56,17 @@ check_config() {
+ # 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
++ [ -d "$DST_CRONSCRIPT_DIR" ] || return
++ 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
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.23-debian-CT-ipv6-fix.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-debian-CT-ipv6-fix.patch
new file mode 100644
index 000000000000..eec864c90a01
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-debian-CT-ipv6-fix.patch
@@ -0,0 +1,24 @@
+From: mathgl <mathgl@freesurf.fr>
+Date: Mon, 17 Nov 2008 18:27:19 +0000 (+0300)
+Subject: Fix IPv6 configuration on a debian lenny container
+X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=9fe02f4a9a42d8d608c401d2508da01f2a07a13e
+
+Fix IPv6 configuration on a debian lenny container
+
+http://bugzilla.openvz.org/show_bug.cgi?id=824
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505792
+---
+
+diff --git a/etc/dists/scripts/debian-add_ip.sh b/etc/dists/scripts/debian-add_ip.sh
+index ca87137..b9bda3e 100755
+--- a/etc/dists/scripts/debian-add_ip.sh
++++ b/etc/dists/scripts/debian-add_ip.sh
+@@ -79,7 +79,7 @@ iface ${VENET_DEV}:${ifnum} inet static
+ " >> ${CFGFILE}.bak
+
+ else
+- sed -i -e "s/netmask\ 128/netmask\ 128\n\tup ifconfig venet0 add ${ip}/" ${CFGFILE}.bak
++ sed -i -e "s/netmask\ 128/netmask\ 128\n\tup ifconfig venet0 add ${ip}\/0/" ${CFGFILE}.bak
+ fi
+
+ }
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.23-forwarding-issue-warning.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-forwarding-issue-warning.patch
new file mode 100644
index 000000000000..8c93a513517b
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-forwarding-issue-warning.patch
@@ -0,0 +1,25 @@
+commit 78ef67a523e7f2589e49a082376ee56ce1a5d76e
+Author: Peter Volkov <pva@gentoo.org>
+Date: Tue Mar 31 13:03:44 2009 +0400
+
+ Issue warning if forwarding is disabled
+
+ In case forwarding is disabled let's warn user about that. This is
+ alternative solution for http://bugzilla.openvz.org/show_bug.cgi?id=1079
+
+diff --git a/etc/init.d/vz-gentoo.in b/etc/init.d/vz-gentoo.in
+index dc87d41..7c57370 100755
+--- a/etc/init.d/vz-gentoo.in
++++ b/etc/init.d/vz-gentoo.in
+@@ -128,6 +128,11 @@ start_net() {
+ ebegin "Configuring interface ${VZDEV}"
+ /sbin/sysctl -q -w net.ipv4.conf.${VZDEV}.send_redirects=0
+ eend $?
++
++ if [ "x$(/sbin/sysctl net.ipv4.ip_forward 2>/dev/null | awk '{print $3}')" = "x0" ]; then
++ ewarn "It looks like you have ip forwarding disabled. To make networking"
++ ewarn "available for containers, please, run sysctl -w net.ipv4.ip_forward=1"
++ fi
+ }
+
+ stop_net() {
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
deleted file mode 100644
index b07a5b301b62..000000000000
--- a/sys-cluster/vzctl/files/vzctl-3.0.23-ipforwarding-on-start.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-=== 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-ppp-feature.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-ppp-feature.patch
new file mode 100644
index 000000000000..9eab5d02d959
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-ppp-feature.patch
@@ -0,0 +1,49 @@
+From: Cyrill Gorcunov <gorcunov@openvz.org>
+Date: Tue, 3 Feb 2009 19:45:36 +0000 (+0300)
+Subject: Introduce new "ppp" feature
+X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=d78a7653d983269553763d536f69de0bb5109353
+
+Introduce new "ppp" feature
+
+Allow an user to turn "ppp" feature on and off.
+
+Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
+---
+
+diff --git a/include/linux/vzcalluser.h b/include/linux/vzcalluser.h
+index 045a0e1..66d61cd 100644
+--- a/include/linux/vzcalluser.h
++++ b/include/linux/vzcalluser.h
+@@ -202,6 +202,7 @@ struct env_create_param3 {
+ #define VE_FEATURE_DEF_PERMS (1ULL << 2)
+ #define VE_FEATURE_SIT (1ULL << 3)
+ #define VE_FEATURE_IPIP (1ULL << 4)
++#define VE_FEATURE_PPP (1ULL << 5)
+
+ #define VE_FEATURES_OLD (VE_FEATURE_SYSFS)
+ #define VE_FEATURES_DEF (VE_FEATURE_SYSFS | \
+diff --git a/man/vzctl.8 b/man/vzctl.8
+index 85d3b0d..92d49e3 100644
+--- a/man/vzctl.8
++++ b/man/vzctl.8
+@@ -446,7 +446,7 @@ designated by its \fImajor\fR and \fIminor\fR numbers. Device file have to be cr
+ .TP
+ \fB--features\fR \fIname\fR:\fBon|off\fR
+ Enable or disable a specific container feature.
+-Known features are: \fIsysfs\fR, \fInfs\fR, \fIsit\fR, \fIipip\fR.
++Known features are: \fIsysfs\fR, \fInfs\fR, \fIsit\fR, \fIipip\fR, \fIppp\fR.
+ .TP
+ \fBApply config\fR
+ .TP
+diff --git a/src/lib/vzfeatures.c b/src/lib/vzfeatures.c
+index 2f5596a..c6af929 100644
+--- a/src/lib/vzfeatures.c
++++ b/src/lib/vzfeatures.c
+@@ -27,6 +27,7 @@ static struct feature_s features[] = {
+ { "nfs", 0, VE_FEATURE_NFS },
+ { "sit", 0, VE_FEATURE_SIT},
+ { "ipip", 0, VE_FEATURE_IPIP},
++ { "ppp", 0, VE_FEATURE_PPP},
+ { NULL}
+ };
+
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
deleted file mode 100644
index eacf6a05db98..000000000000
--- a/sys-cluster/vzctl/files/vzctl-3.0.23-set-cron-jobs.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-=== 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
index 1a4761a716db..d3c803ee4307 100644
--- 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
@@ -1,6 +1,28 @@
-=== 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
+From: Peter Volkov <pva@gentoo.org>
+Date: Sun, 30 Nov 2008 13:48:39 +0000 (+0300)
+Subject: Added unlimited CT config
+X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=c8dc6e5a60137eafca882c39ffbeb0177e65a064
+
+Added unlimited CT config
+
+This implements (again thank Daniel Robbins for suggestion and initial
+work) ve-unlimited.conf-sample configuration file. It sets CT resources
+to unlimited values. Not to repeating his reasoning I cite him here:
+
+"I think that adding this to the /etc/vz/conf directory would be a big
+step forward. I think that OpenVZ is going to be used more and more for
+single-developer workstations where developers want to use containers to
+create test environments. In these single-user situations, resource limits
+just get in the way."
+
+I tend to aggree. If you just want to use containers like very smart
+chroots resource limits just make things harder.
+---
+
+diff --git a/etc/conf/Makefile.am b/etc/conf/Makefile.am
+index 963abdc..52c16e8 100644
+--- a/etc/conf/Makefile.am
++++ b/etc/conf/Makefile.am
@@ -18,7 +18,7 @@
include $(top_srcdir)/paths.am
@@ -10,11 +32,12 @@
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 @@
+diff --git a/etc/conf/ve-unlimited.conf-sample b/etc/conf/ve-unlimited.conf-sample
+new file mode 100644
+index 0000000..2b9febd
+--- /dev/null
++++ b/etc/conf/ve-unlimited.conf-sample
+@@ -0,0 +1,51 @@
+# Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
@@ -38,38 +61,40 @@
+
+# UBC parameters (in form of barrier:limit)
+# Primary parameters
-+AVNUMPROC="9223372036854775807:9223372036854775807"
-+NUMPROC="9223372036854775807:9223372036854775807"
-+NUMTCPSOCK="9223372036854775807:9223372036854775807"
-+NUMOTHERSOCK="9223372036854775807:9223372036854775807"
-+VMGUARPAGES="9223372036854775807:9223372036854775807"
++AVNUMPROC="unlimited"
++NUMPROC="unlimited"
++NUMTCPSOCK="419430"
++NUMOTHERSOCK="419430"
++VMGUARPAGES="unlimited"
+# Secondary parameters
-+KMEMSIZE="9223372036854775807:9223372036854775807"
-+TCPSNDBUF="9223372036854775807:9223372036854775807"
-+TCPRCVBUF="9223372036854775807:9223372036854775807"
-+OTHERSOCKBUF="9223372036854775807:9223372036854775807"
-+DGRAMRCVBUF="9223372036854775807:9223372036854775807"
-+OOMGUARPAGES="9223372036854775807:9223372036854775807"
++KMEMSIZE="unlimited"
++#TCPSNDBUF="2147483647:2147483647"
++TCPSNDBUF="1073741823:2147483647"
++TCPRCVBUF="1073741823:2147483647"
++OTHERSOCKBUF="1073741823:2147483647"
++DGRAMRCVBUF="unlimited"
++OOMGUARPAGES="unlimited"
+# 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"
++LOCKEDPAGES="unlimited"
++SHMPAGES="unlimited"
++PRIVVMPAGES="unlimited"
++NUMFILE="unlimited"
++NUMFLOCK="unlimited"
++NUMPTY="unlimited"
++NUMSIGINFO="unlimited"
++DCACHESIZE="unlimited"
+
-+PHYSPAGES="9223372036854775807:9223372036854775807"
-+NUMIPTENT="9223372036854775807:9223372036854775807"
++PHYSPAGES="0:unlimited"
++NUMIPTENT="unlimited"
+
+# 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 @@
+diff --git a/etc/conf/ve-unlimited.conf-sample.ia64 b/etc/conf/ve-unlimited.conf-sample.ia64
+new file mode 100644
+index 0000000..42fd7f6
+--- /dev/null
++++ b/etc/conf/ve-unlimited.conf-sample.ia64
+@@ -0,0 +1,51 @@
+# Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
@@ -93,38 +118,40 @@
+
+# UBC parameters (in form of barrier:limit)
+# Primary parameters
-+AVNUMPROC="2147483647:2147483647"
-+NUMPROC="2147483647:2147483647"
-+NUMTCPSOCK="2147483647:2147483647"
-+NUMOTHERSOCK="2147483647:2147483647"
-+VMGUARPAGES="2147483647:2147483647"
++AVNUMPROC="unlimited"
++NUMPROC="unlimited"
++NUMTCPSOCK="1801439850948198"
++NUMOTHERSOCK="1801439850948198"
++VMGUARPAGES="unlimited"
+# Secondary parameters
-+KMEMSIZE="2147483647:2147483647"
-+TCPSNDBUF="2147483647:2147483647"
-+TCPRCVBUF="2147483647:2147483647"
-+OTHERSOCKBUF="2147483647:2147483647"
-+DGRAMRCVBUF="2147483647:2147483647"
-+OOMGUARPAGES="2147483647:2147483647"
++KMEMSIZE="unlimited"
++#TCPSNDBUF="2147483647:2147483647"
++TCPSNDBUF="4611686018427387903:9223372036854775807"
++TCPRCVBUF="4611686018427387903:9223372036854775807"
++OTHERSOCKBUF="4611686018427387903:9223372036854775807"
++DGRAMRCVBUF="unlimited"
++OOMGUARPAGES="unlimited"
+# 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"
++LOCKEDPAGES="unlimited"
++SHMPAGES="unlimited"
++PRIVVMPAGES="unlimited"
++NUMFILE="unlimited"
++NUMFLOCK="unlimited"
++NUMPTY="unlimited"
++NUMSIGINFO="unlimited"
++DCACHESIZE="unlimited"
+
-+PHYSPAGES="2147483647:2147483647"
-+NUMIPTENT="2147483647:2147483647"
++PHYSPAGES="0:unlimited"
++NUMIPTENT="unlimited"
+
+# 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 @@
+diff --git a/etc/conf/ve-unlimited.conf-sample.x86_64 b/etc/conf/ve-unlimited.conf-sample.x86_64
+new file mode 100644
+index 0000000..42fd7f6
+--- /dev/null
++++ b/etc/conf/ve-unlimited.conf-sample.x86_64
+@@ -0,0 +1,51 @@
+# Copyright (C) 2000-2008, Parallels, Inc. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
@@ -148,31 +175,31 @@
+
+# UBC parameters (in form of barrier:limit)
+# Primary parameters
-+AVNUMPROC="9223372036854775807:9223372036854775807"
-+NUMPROC="9223372036854775807:9223372036854775807"
-+NUMTCPSOCK="9223372036854775807:9223372036854775807"
-+NUMOTHERSOCK="9223372036854775807:9223372036854775807"
-+VMGUARPAGES="9223372036854775807:9223372036854775807"
++AVNUMPROC="unlimited"
++NUMPROC="unlimited"
++NUMTCPSOCK="1801439850948198"
++NUMOTHERSOCK="1801439850948198"
++VMGUARPAGES="unlimited"
+# Secondary parameters
-+KMEMSIZE="9223372036854775807:9223372036854775807"
-+TCPSNDBUF="9223372036854775807:9223372036854775807"
-+TCPRCVBUF="9223372036854775807:9223372036854775807"
-+OTHERSOCKBUF="9223372036854775807:9223372036854775807"
-+DGRAMRCVBUF="9223372036854775807:9223372036854775807"
-+OOMGUARPAGES="9223372036854775807:9223372036854775807"
++KMEMSIZE="unlimited"
++#TCPSNDBUF="2147483647:2147483647"
++TCPSNDBUF="4611686018427387903:9223372036854775807"
++TCPRCVBUF="4611686018427387903:9223372036854775807"
++OTHERSOCKBUF="4611686018427387903:9223372036854775807"
++DGRAMRCVBUF="unlimited"
++OOMGUARPAGES="unlimited"
+# 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"
++LOCKEDPAGES="unlimited"
++SHMPAGES="unlimited"
++PRIVVMPAGES="unlimited"
++NUMFILE="unlimited"
++NUMFLOCK="unlimited"
++NUMPTY="unlimited"
++NUMSIGINFO="unlimited"
++DCACHESIZE="unlimited"
+
-+PHYSPAGES="9223372036854775807:9223372036854775807"
-+NUMIPTENT="9223372036854775807:9223372036854775807"
++PHYSPAGES="0:unlimited"
++NUMIPTENT="unlimited"
+
+# Disk quota parameters (in form of softlimit:hardlimit)
+DISK_QUOTA="no"
-
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.23-vzarp-on-ifup.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-vzarp-on-ifup.patch
new file mode 100644
index 000000000000..a0d020d409c6
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-vzarp-on-ifup.patch
@@ -0,0 +1,122 @@
+http://556.bugzilla.openvz.org/attachment.cgi?id=829
+
+We need to test this patch. Hey, anybody?
+
+diff --git a/Makefile.am b/Makefile.am
+index 3b67cd8..ae05b3b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -53,6 +53,7 @@ DISTRO_TARGETS = \
+
+ $(DISTRO_TARGETS):
+ $(MAKE) $(AM_MAKEFLAGS) -C etc $@
++ $(MAKE) $(AM_MAKEFLAGS) -C scripts $@
+
+ install-data-hook:
+ @echo
+diff --git a/scripts/Makefile.am b/scripts/Makefile.am
+index a2bde7e..85ea8fd 100644
+--- a/scripts/Makefile.am
++++ b/scripts/Makefile.am
+@@ -22,7 +22,8 @@ vzlib_SCRIPTS = \
+ vps-functions \
+ vps-net_add \
+ vps-net_del \
+- vps-stop
++ vps-stop \
++ ifup-vz-arp
+
+ vzcron_SCRIPTS = \
+ vpsnetclean \
+@@ -35,3 +36,36 @@ EXTRA_DIST = \
+ CLEANFILES = \
+ $(vzlib_SCRIPTS) \
+ $(vzcron_SCRIPTS)
++
++# FIXME: what to do in case DESTDIR is set? I guess nothing...
++install-redhat:
++ if [ ! -e /sbin/ifup-local ]; then \
++ ln -sf @PKGLIBDIR@/scripts/ifup-vz-arp /sbin/ifup-local; \
++ else \
++ @echo; \
++ @echo " ***************************************************"; \
++ @echo " WARNING: /sbin/ifup-local is present!"; \
++ @echo " You have to manually edit /sbin/ifup-local so that "; \
++ @echo " @PKGLIBDIR@/scripts/ifup-vz-arp"; \
++ @echo " is called from it."; \
++ @echo " ***************************************************"; \
++ @echo; \
++ fi
++
++
++install-suse:
++ ln -sf @PKGLIBDIR@/scripts/ifup-vz-arp /etc/sysconfig/network/if-up.d/
++
++install-debian:
++ ln -sf @PKGLIBDIR@/scripts/ifup-vz-arp /etc/network/if-up.d/
++
++install-gentoo:
++ @echo
++ @echo " ***************************************************"
++ @echo " Please add the following code to /etc/conf.d/net:"
++ @echo
++ @echo "postup() {"
++ @echo " @PKGLIBDIR@/scripts/ifup-vz-arp" '"${IFACE}"'
++ @echo "}"
++ @echo " ***************************************************"
++ @echo
+diff --git a/scripts/ifup-vz-arp.in b/scripts/ifup-vz-arp.in
+new file mode 100755
+index 0000000..7e2346b
+--- /dev/null
++++ b/scripts/ifup-vz-arp.in
+@@ -0,0 +1,25 @@
++#!/bin/bash
++# Copyright (C) 2008, Parallels, Inc. All rights reserved.
++#
++# Update ARP table for all containers on interface up
++
++[ ! -f /proc/vz/veinfo ] && exit 0
++
++test -f @PKGLIBDIR@/scripts/vps-functions || exit 1
++test -f @PKGCONFDIR@/vz.conf || exit 1
++. @PKGLIBDIR@/scripts/vps-functions
++. @PKGCONFDIR@/vz.conf
++
++update_arp()
++{
++ local veip
++ for veip in $(awk '!/^Version/ { print $1 }' /proc/vz/veip); do
++ vzarp add ${veip}
++ done
++}
++
++DEV=$1
++[ -z "${DEV}" ] && exit 0
++NETDEVICES="${DEV}"
++update_arp
++exit 0
+diff --git a/vzctl.spec b/vzctl.spec
+index ae3ed8c..adc6702 100644
+--- a/vzctl.spec
++++ b/vzctl.spec
+@@ -108,6 +108,7 @@ rm -rf $RPM_BUILD_ROOT
+ %attr(755,root,root) %{_sbindir}/vzmigrate
+ %attr(755,root,root) %{_scriptdir}/vpsreboot
+ %attr(755,root,root) %{_scriptdir}/vpsnetclean
++%attr(755,root,root) %{_scriptdir}/ifup-vz-arp
+ %attr(644,root,root) %{_logrdir}/vzctl
+ %attr(644,root,root) %{_distconfdir}/distribution.conf-template
+ %attr(644,root,root) %{_distconfdir}/default
+@@ -161,6 +162,11 @@ if [ -f /etc/SuSE-release ]; then
+ for file in ${NET_CFG}; do
+ ln -sf /etc/sysconfig/network-scripts/${file} /etc/sysconfig/network/scripts/${file}
+ done
++ ln -sf /usr/share/vzctl/scripts/ifup-vz-arp /etc/sysconfig/network/if-up.d/ifup-arp
++else # RedHat/Fedora/CentOS case
++ if [ ! -e /sbin/ifup-local ]; then
++ ln -sf /usr/share/vzctl/scripts/ifup-vz-arp /sbin/ifup-local
++ fi
+ fi
+
+ %preun
diff --git a/sys-cluster/vzctl/files/vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch b/sys-cluster/vzctl/files/vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch
new file mode 100644
index 000000000000..b8361e487349
--- /dev/null
+++ b/sys-cluster/vzctl/files/vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch
@@ -0,0 +1,92 @@
+From: Dmitry V. Levin <ldv@altlinux.org>
+Date: Fri, 31 Oct 2008 11:54:47 +0000 (+0000)
+Subject: vznetaddbr.in: Rewrite without bash-isms and ifconfig
+X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=93ef4d978a8c609cc04c53f39bc4fe674a089811
+
+vznetaddbr.in: Rewrite without bash-isms and ifconfig
+
+Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
+---
+
+diff --git a/bin/vznetaddbr.in b/bin/vznetaddbr.in
+index eb2ba70..e8599e9 100755
+--- a/bin/vznetaddbr.in
++++ b/bin/vznetaddbr.in
+@@ -1,53 +1,39 @@
+-#!/bin/bash
++#!/bin/sh
+ #
+ # Add virtual network interfaces (veth's) in a container to a bridge on CT0
+
+ CONFIGFILE=@PKGCONFDIR@/conf/$VEID.conf
+ . $CONFIGFILE
+
+-NETIFLIST=$(echo $NETIF | sed 's/;/\n/g')
++NETIFLIST=$(printf %s "$NETIF" |tr ';' '\n')
+
+-if [ ! -n "$NETIFLIST" ]; then
+- echo "According to $CONFIGFILE, CT$VEID has no veth interface configured."
++if [ -z "$NETIFLIST" ]; then
++ echo >&2 "According to $CONFIGFILE, CT$VEID has no veth interface configured."
+ exit 1
+ fi
+
+-IFACES=$(echo $NETIFLIST | sed 's/;/\n/g')
+-for tmp in $IFACES; do
+- CTIFNAME=
+- CTBRIDGE=
+- VZHOSTIF=
+-
+- NETIF_OPTIONS=$(echo $tmp | sed 's/,/\n/g')
+- for str in $NETIF_OPTIONS; do
+- # getting 'ifname' parameter value
+- if [[ "$str" =~ ^ifname= ]]; then
+- # remove the parameter name from the string (along with '=')
+- CTIFNAME=${str#*=}
+- fi
+- if [[ "$str" =~ ^bridge= ]]; then
+- # remove the parameter name from the string (along with '=')
+- CTBRIDGE=${str#*=}
+- fi
+- # getting 'host_ifname' parameter value
+- if [[ "$str" =~ ^host_ifname= ]]; then
+- # remove the parameter name from the string (along with '=')
+- VZHOSTIF=${str#*=}
+- fi
++for iface in $NETIFLIST; do
++ bridge=
++ host_ifname=
++
++ for str in $(printf %s "$iface" |tr ',' '\n'); do
++ case "$str" in
++ bridge=*|host_ifname=*)
++ eval "${str%%=*}=\${str#*=}" ;;
++ esac
+ done
+
+- if [ "$VZHOSTIF" != "$3" ]; then
+- continue
+- fi
+- if [ ! -n "$CTBRIDGE" ]; then
+- CTBRIDGE=vmbr0
+- fi
+-
+- echo "Adding interface $VZHOSTIF to bridge $CTBRIDGE on CT0 for CT$VEID"
+- /sbin/ifconfig $VZHOSTIF 0
+- echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/proxy_arp
+- echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/forwarding
+- /usr/sbin/brctl addif $CTBRIDGE $VZHOSTIF
++ [ "$host_ifname" = "$3" ] ||
++ continue
++
++ [ -n "$bridge" ] ||
++ bridge=vmbr0
++
++ echo "Adding interface $host_ifname to bridge $bridge on CT0 for CT$VEID"
++ ip addr add 0 dev "$host_ifname"
++ echo 1 >"/proc/sys/net/ipv4/conf/$host_ifname/proxy_arp"
++ echo 1 >"/proc/sys/net/ipv4/conf/$host_ifname/forwarding"
++ brctl addif "$bridge" "$host_ifname"
+
+ break
+ done
diff --git a/sys-cluster/vzctl/vzctl-3.0.22-r2.ebuild b/sys-cluster/vzctl/vzctl-3.0.22-r2.ebuild
index 9f637386dd7c..b40a01a78b5a 100644
--- a/sys-cluster/vzctl/vzctl-3.0.22-r2.ebuild
+++ b/sys-cluster/vzctl/vzctl-3.0.22-r2.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 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-r2.ebuild,v 1.1 2008/11/08 19:41:59 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-3.0.22-r2.ebuild,v 1.2 2009/03/31 09:16:33 pva Exp $
inherit bash-completion eutils
@@ -10,7 +10,7 @@ SRC_URI="http://download.openvz.org/utils/${PN}/${PV}/src/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~amd64 ~ia64 ~ppc64 ~sparc ~x86"
+KEYWORDS="amd64 ~ia64 ~ppc64 ~sparc x86"
IUSE="bash-completion logrotate"
RDEPEND="logrotate? ( app-admin/logrotate )
diff --git a/sys-cluster/vzctl/vzctl-3.0.23.ebuild b/sys-cluster/vzctl/vzctl-3.0.23-r1.ebuild
index 5c6f2e2717ef..6dd372383c73 100644
--- a/sys-cluster/vzctl/vzctl-3.0.23.ebuild
+++ b/sys-cluster/vzctl/vzctl-3.0.23-r1.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-3.0.23.ebuild,v 1.1 2008/11/15 13:01:30 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/vzctl-3.0.23-r1.ebuild,v 1.1 2009/03/31 09:16:33 pva Exp $
inherit bash-completion eutils autotools
@@ -29,9 +29,15 @@ pkg_setup() {
src_unpack() {
unpack ${A}
cd "${S}"
- epatch "${FILESDIR}/${P}-ipforwarding-on-start.patch"
+ epatch "${FILESDIR}/${P}-vznetaddbr.in-no-bashisms.patch"
epatch "${FILESDIR}/${P}-ve-unlimited.conf-sample.patch"
- epatch "${FILESDIR}/${P}-set-cron-jobs.patch"
+ epatch "${FILESDIR}/${P}-debian-CT-ipv6-fix.patch"
+ epatch "${FILESDIR}/${P}-cronjobs-typo-fix.patch"
+ epatch "${FILESDIR}/${P}-cronjobs-issue-warning.patch"
+ epatch "${FILESDIR}/${P}-vzarp-on-ifup.patch"
+ epatch "${FILESDIR}/${P}-ppp-feature.patch"
+ epatch "${FILESDIR}/${P}-UBC-parameter-swappages.patch"
+ epatch "${FILESDIR}/${P}-forwarding-issue-warning.patch"
eautomake
}
@@ -80,12 +86,4 @@ 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."
}