1 |
pva 09/03/31 09:16:33 |
2 |
|
3 |
Modified: vzctl-3.0.23-ve-unlimited.conf-sample.patch |
4 |
Added: vzctl-3.0.23-cronjobs-issue-warning.patch |
5 |
vzctl-3.0.23-UBC-parameter-swappages.patch |
6 |
vzctl-3.0.23-forwarding-issue-warning.patch |
7 |
vzctl-3.0.23-vzarp-on-ifup.patch |
8 |
vzctl-3.0.23-ppp-feature.patch |
9 |
vzctl-3.0.23-cronjobs-typo-fix.patch |
10 |
vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch |
11 |
vzctl-3.0.23-debian-CT-ipv6-fix.patch |
12 |
Removed: vzctl-3.0.23-set-cron-jobs.patch |
13 |
vzctl-3.0.23-ipforwarding-on-start.patch |
14 |
Log: |
15 |
Backport some fixes from git, update patches to be likely included (or already included) by upstream. Remove old. Stabilize 3.0.22-r2. |
16 |
(Portage version: 2.2_rc28/cvs/Linux i686) |
17 |
|
18 |
Revision Changes Path |
19 |
1.2 sys-cluster/vzctl/files/vzctl-3.0.23-ve-unlimited.conf-sample.patch |
20 |
|
21 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-ve-unlimited.conf-sample.patch?rev=1.2&view=markup |
22 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-ve-unlimited.conf-sample.patch?rev=1.2&content-type=text/plain |
23 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-ve-unlimited.conf-sample.patch?r1=1.1&r2=1.2 |
24 |
|
25 |
Index: vzctl-3.0.23-ve-unlimited.conf-sample.patch |
26 |
=================================================================== |
27 |
RCS file: /var/cvsroot/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-ve-unlimited.conf-sample.patch,v |
28 |
retrieving revision 1.1 |
29 |
retrieving revision 1.2 |
30 |
diff -u -r1.1 -r1.2 |
31 |
--- vzctl-3.0.23-ve-unlimited.conf-sample.patch 15 Nov 2008 13:01:31 -0000 1.1 |
32 |
+++ vzctl-3.0.23-ve-unlimited.conf-sample.patch 31 Mar 2009 09:16:33 -0000 1.2 |
33 |
@@ -1,6 +1,28 @@ |
34 |
-=== modified file 'etc/conf/Makefile.am' |
35 |
---- etc/conf/Makefile.am 2008-11-15 09:57:13 +0000 |
36 |
-+++ etc/conf/Makefile.am 2008-11-15 10:44:26 +0000 |
37 |
+From: Peter Volkov <pva@g.o> |
38 |
+Date: Sun, 30 Nov 2008 13:48:39 +0000 (+0300) |
39 |
+Subject: Added unlimited CT config |
40 |
+X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=c8dc6e5a60137eafca882c39ffbeb0177e65a064 |
41 |
+ |
42 |
+Added unlimited CT config |
43 |
+ |
44 |
+This implements (again thank Daniel Robbins for suggestion and initial |
45 |
+work) ve-unlimited.conf-sample configuration file. It sets CT resources |
46 |
+to unlimited values. Not to repeating his reasoning I cite him here: |
47 |
+ |
48 |
+"I think that adding this to the /etc/vz/conf directory would be a big |
49 |
+step forward. I think that OpenVZ is going to be used more and more for |
50 |
+single-developer workstations where developers want to use containers to |
51 |
+create test environments. In these single-user situations, resource limits |
52 |
+just get in the way." |
53 |
+ |
54 |
+I tend to aggree. If you just want to use containers like very smart |
55 |
+chroots resource limits just make things harder. |
56 |
+--- |
57 |
+ |
58 |
+diff --git a/etc/conf/Makefile.am b/etc/conf/Makefile.am |
59 |
+index 963abdc..52c16e8 100644 |
60 |
+--- a/etc/conf/Makefile.am |
61 |
++++ b/etc/conf/Makefile.am |
62 |
@@ -18,7 +18,7 @@ |
63 |
include $(top_srcdir)/paths.am |
64 |
|
65 |
@@ -10,11 +32,12 @@ |
66 |
|
67 |
if ARCH_IA64 |
68 |
VECONFIG_EXT = .ia64 |
69 |
- |
70 |
-=== added file 'etc/conf/ve-unlimited.conf-sample.ia64' |
71 |
---- etc/conf/ve-unlimited.conf-sample.ia64 1970-01-01 00:00:00 +0000 |
72 |
-+++ etc/conf/ve-unlimited.conf-sample.ia64 2008-11-15 10:43:49 +0000 |
73 |
-@@ -0,0 +1,50 @@ |
74 |
+diff --git a/etc/conf/ve-unlimited.conf-sample b/etc/conf/ve-unlimited.conf-sample |
75 |
+new file mode 100644 |
76 |
+index 0000000..2b9febd |
77 |
+--- /dev/null |
78 |
++++ b/etc/conf/ve-unlimited.conf-sample |
79 |
+@@ -0,0 +1,51 @@ |
80 |
+# Copyright (C) 2000-2008, Parallels, Inc. All rights reserved. |
81 |
+# |
82 |
+# This program is free software; you can redistribute it and/or modify |
83 |
@@ -38,38 +61,40 @@ |
84 |
+ |
85 |
+# UBC parameters (in form of barrier:limit) |
86 |
+# Primary parameters |
87 |
-+AVNUMPROC="9223372036854775807:9223372036854775807" |
88 |
-+NUMPROC="9223372036854775807:9223372036854775807" |
89 |
-+NUMTCPSOCK="9223372036854775807:9223372036854775807" |
90 |
-+NUMOTHERSOCK="9223372036854775807:9223372036854775807" |
91 |
-+VMGUARPAGES="9223372036854775807:9223372036854775807" |
92 |
++AVNUMPROC="unlimited" |
93 |
++NUMPROC="unlimited" |
94 |
++NUMTCPSOCK="419430" |
95 |
++NUMOTHERSOCK="419430" |
96 |
++VMGUARPAGES="unlimited" |
97 |
+# Secondary parameters |
98 |
-+KMEMSIZE="9223372036854775807:9223372036854775807" |
99 |
-+TCPSNDBUF="9223372036854775807:9223372036854775807" |
100 |
-+TCPRCVBUF="9223372036854775807:9223372036854775807" |
101 |
-+OTHERSOCKBUF="9223372036854775807:9223372036854775807" |
102 |
-+DGRAMRCVBUF="9223372036854775807:9223372036854775807" |
103 |
-+OOMGUARPAGES="9223372036854775807:9223372036854775807" |
104 |
++KMEMSIZE="unlimited" |
105 |
++#TCPSNDBUF="2147483647:2147483647" |
106 |
++TCPSNDBUF="1073741823:2147483647" |
107 |
++TCPRCVBUF="1073741823:2147483647" |
108 |
++OTHERSOCKBUF="1073741823:2147483647" |
109 |
++DGRAMRCVBUF="unlimited" |
110 |
++OOMGUARPAGES="unlimited" |
111 |
+# Auxiliary parameters |
112 |
-+LOCKEDPAGES="9223372036854775807:9223372036854775807" |
113 |
-+SHMPAGES="9223372036854775807:9223372036854775807" |
114 |
-+PRIVVMPAGES="9223372036854775807:9223372036854775807" |
115 |
-+NUMFILE="9223372036854775807:9223372036854775807" |
116 |
-+NUMFLOCK="9223372036854775807:9223372036854775807" |
117 |
-+NUMPTY="9223372036854775807:9223372036854775807" |
118 |
-+NUMSIGINFO="9223372036854775807:9223372036854775807" |
119 |
-+DCACHESIZE="9223372036854775807:9223372036854775807" |
120 |
++LOCKEDPAGES="unlimited" |
121 |
++SHMPAGES="unlimited" |
122 |
++PRIVVMPAGES="unlimited" |
123 |
++NUMFILE="unlimited" |
124 |
++NUMFLOCK="unlimited" |
125 |
++NUMPTY="unlimited" |
126 |
++NUMSIGINFO="unlimited" |
127 |
++DCACHESIZE="unlimited" |
128 |
+ |
129 |
-+PHYSPAGES="9223372036854775807:9223372036854775807" |
130 |
-+NUMIPTENT="9223372036854775807:9223372036854775807" |
131 |
++PHYSPAGES="0:unlimited" |
132 |
++NUMIPTENT="unlimited" |
133 |
+ |
134 |
+# Disk quota parameters (in form of softlimit:hardlimit) |
135 |
+DISK_QUOTA="no" |
136 |
- |
137 |
-=== added file 'etc/conf/ve-unlimited.conf-sample.x86' |
138 |
---- etc/conf/ve-unlimited.conf-sample.x86 1970-01-01 00:00:00 +0000 |
139 |
-+++ etc/conf/ve-unlimited.conf-sample.x86 2008-11-15 10:43:15 +0000 |
140 |
-@@ -0,0 +1,50 @@ |
141 |
+diff --git a/etc/conf/ve-unlimited.conf-sample.ia64 b/etc/conf/ve-unlimited.conf-sample.ia64 |
142 |
+new file mode 100644 |
143 |
+index 0000000..42fd7f6 |
144 |
+--- /dev/null |
145 |
++++ b/etc/conf/ve-unlimited.conf-sample.ia64 |
146 |
+@@ -0,0 +1,51 @@ |
147 |
+# Copyright (C) 2000-2008, Parallels, Inc. All rights reserved. |
148 |
+# |
149 |
+# This program is free software; you can redistribute it and/or modify |
150 |
@@ -93,38 +118,40 @@ |
151 |
+ |
152 |
+# UBC parameters (in form of barrier:limit) |
153 |
+# Primary parameters |
154 |
-+AVNUMPROC="2147483647:2147483647" |
155 |
-+NUMPROC="2147483647:2147483647" |
156 |
-+NUMTCPSOCK="2147483647:2147483647" |
157 |
-+NUMOTHERSOCK="2147483647:2147483647" |
158 |
-+VMGUARPAGES="2147483647:2147483647" |
159 |
++AVNUMPROC="unlimited" |
160 |
++NUMPROC="unlimited" |
161 |
++NUMTCPSOCK="1801439850948198" |
162 |
++NUMOTHERSOCK="1801439850948198" |
163 |
++VMGUARPAGES="unlimited" |
164 |
+# Secondary parameters |
165 |
-+KMEMSIZE="2147483647:2147483647" |
166 |
-+TCPSNDBUF="2147483647:2147483647" |
167 |
-+TCPRCVBUF="2147483647:2147483647" |
168 |
-+OTHERSOCKBUF="2147483647:2147483647" |
169 |
-+DGRAMRCVBUF="2147483647:2147483647" |
170 |
-+OOMGUARPAGES="2147483647:2147483647" |
171 |
++KMEMSIZE="unlimited" |
172 |
++#TCPSNDBUF="2147483647:2147483647" |
173 |
++TCPSNDBUF="4611686018427387903:9223372036854775807" |
174 |
++TCPRCVBUF="4611686018427387903:9223372036854775807" |
175 |
++OTHERSOCKBUF="4611686018427387903:9223372036854775807" |
176 |
++DGRAMRCVBUF="unlimited" |
177 |
++OOMGUARPAGES="unlimited" |
178 |
+# Auxiliary parameters |
179 |
-+LOCKEDPAGES="2147483647:2147483647" |
180 |
-+SHMPAGES="2147483647:2147483647" |
181 |
-+PRIVVMPAGES="2147483647:2147483647" |
182 |
-+NUMFILE="2147483647:2147483647" |
183 |
-+NUMFLOCK="2147483647:2147483647" |
184 |
-+NUMPTY="2147483647:2147483647" |
185 |
-+NUMSIGINFO="2147483647:2147483647" |
186 |
-+DCACHESIZE="2147483647:2147483647" |
187 |
++LOCKEDPAGES="unlimited" |
188 |
++SHMPAGES="unlimited" |
189 |
++PRIVVMPAGES="unlimited" |
190 |
++NUMFILE="unlimited" |
191 |
++NUMFLOCK="unlimited" |
192 |
++NUMPTY="unlimited" |
193 |
++NUMSIGINFO="unlimited" |
194 |
++DCACHESIZE="unlimited" |
195 |
+ |
196 |
-+PHYSPAGES="2147483647:2147483647" |
197 |
-+NUMIPTENT="2147483647:2147483647" |
198 |
++PHYSPAGES="0:unlimited" |
199 |
++NUMIPTENT="unlimited" |
200 |
+ |
201 |
+# Disk quota parameters (in form of softlimit:hardlimit) |
202 |
+DISK_QUOTA="no" |
203 |
- |
204 |
-=== added file 'etc/conf/ve-unlimited.conf-sample.x86_64' |
205 |
---- etc/conf/ve-unlimited.conf-sample.x86_64 1970-01-01 00:00:00 +0000 |
206 |
-+++ etc/conf/ve-unlimited.conf-sample.x86_64 2008-11-15 10:43:59 +0000 |
207 |
-@@ -0,0 +1,50 @@ |
208 |
+diff --git a/etc/conf/ve-unlimited.conf-sample.x86_64 b/etc/conf/ve-unlimited.conf-sample.x86_64 |
209 |
+new file mode 100644 |
210 |
+index 0000000..42fd7f6 |
211 |
+--- /dev/null |
212 |
++++ b/etc/conf/ve-unlimited.conf-sample.x86_64 |
213 |
+@@ -0,0 +1,51 @@ |
214 |
+# Copyright (C) 2000-2008, Parallels, Inc. All rights reserved. |
215 |
+# |
216 |
+# This program is free software; you can redistribute it and/or modify |
217 |
@@ -148,31 +175,31 @@ |
218 |
+ |
219 |
+# UBC parameters (in form of barrier:limit) |
220 |
+# Primary parameters |
221 |
-+AVNUMPROC="9223372036854775807:9223372036854775807" |
222 |
-+NUMPROC="9223372036854775807:9223372036854775807" |
223 |
-+NUMTCPSOCK="9223372036854775807:9223372036854775807" |
224 |
-+NUMOTHERSOCK="9223372036854775807:9223372036854775807" |
225 |
-+VMGUARPAGES="9223372036854775807:9223372036854775807" |
226 |
++AVNUMPROC="unlimited" |
227 |
++NUMPROC="unlimited" |
228 |
++NUMTCPSOCK="1801439850948198" |
229 |
++NUMOTHERSOCK="1801439850948198" |
230 |
++VMGUARPAGES="unlimited" |
231 |
+# Secondary parameters |
232 |
-+KMEMSIZE="9223372036854775807:9223372036854775807" |
233 |
-+TCPSNDBUF="9223372036854775807:9223372036854775807" |
234 |
-+TCPRCVBUF="9223372036854775807:9223372036854775807" |
235 |
-+OTHERSOCKBUF="9223372036854775807:9223372036854775807" |
236 |
-+DGRAMRCVBUF="9223372036854775807:9223372036854775807" |
237 |
-+OOMGUARPAGES="9223372036854775807:9223372036854775807" |
238 |
++KMEMSIZE="unlimited" |
239 |
++#TCPSNDBUF="2147483647:2147483647" |
240 |
++TCPSNDBUF="4611686018427387903:9223372036854775807" |
241 |
++TCPRCVBUF="4611686018427387903:9223372036854775807" |
242 |
++OTHERSOCKBUF="4611686018427387903:9223372036854775807" |
243 |
++DGRAMRCVBUF="unlimited" |
244 |
++OOMGUARPAGES="unlimited" |
245 |
+# Auxiliary parameters |
246 |
-+LOCKEDPAGES="9223372036854775807:9223372036854775807" |
247 |
-+SHMPAGES="9223372036854775807:9223372036854775807" |
248 |
-+PRIVVMPAGES="9223372036854775807:9223372036854775807" |
249 |
-+NUMFILE="9223372036854775807:9223372036854775807" |
250 |
-+NUMFLOCK="9223372036854775807:9223372036854775807" |
251 |
-+NUMPTY="9223372036854775807:9223372036854775807" |
252 |
-+NUMSIGINFO="9223372036854775807:9223372036854775807" |
253 |
-+DCACHESIZE="9223372036854775807:9223372036854775807" |
254 |
++LOCKEDPAGES="unlimited" |
255 |
++SHMPAGES="unlimited" |
256 |
++PRIVVMPAGES="unlimited" |
257 |
++NUMFILE="unlimited" |
258 |
++NUMFLOCK="unlimited" |
259 |
++NUMPTY="unlimited" |
260 |
++NUMSIGINFO="unlimited" |
261 |
++DCACHESIZE="unlimited" |
262 |
+ |
263 |
-+PHYSPAGES="9223372036854775807:9223372036854775807" |
264 |
-+NUMIPTENT="9223372036854775807:9223372036854775807" |
265 |
++PHYSPAGES="0:unlimited" |
266 |
++NUMIPTENT="unlimited" |
267 |
+ |
268 |
+# Disk quota parameters (in form of softlimit:hardlimit) |
269 |
+DISK_QUOTA="no" |
270 |
- |
271 |
|
272 |
|
273 |
|
274 |
1.1 sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-issue-warning.patch |
275 |
|
276 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-issue-warning.patch?rev=1.1&view=markup |
277 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-issue-warning.patch?rev=1.1&content-type=text/plain |
278 |
|
279 |
Index: vzctl-3.0.23-cronjobs-issue-warning.patch |
280 |
=================================================================== |
281 |
commit 5f0d3dbcdb5f1f1f9d019619c4e3dd3b2f2d29f3 |
282 |
Author: Peter Volkov <pva@g.o> |
283 |
Date: Tue Mar 31 12:31:01 2009 +0400 |
284 |
|
285 |
Issue warning if cronjobs aren't automatically set |
286 |
|
287 |
Init script is supposed to set cronjobs automatically on start and remove |
288 |
them on stop. This works only with cron daemons that may hook at runtime |
289 |
scripts at ${DST_CRONSCRIPT_DIR} (e.g. sys-process/vixie-cron can). For |
290 |
other cron daemons it's safer to warn users to set cronjobs manually. |
291 |
|
292 |
diff --git a/etc/init.d/vz-gentoo.in b/etc/init.d/vz-gentoo.in |
293 |
index 97ea313..dc87d41 100755 |
294 |
--- a/etc/init.d/vz-gentoo.in |
295 |
+++ b/etc/init.d/vz-gentoo.in |
296 |
@@ -57,7 +57,19 @@ check_config() { |
297 |
setup_cron() |
298 |
{ |
299 |
[ -z "$SRC_CRONSCRIPT_DIR" ] && return |
300 |
- [ -d "$DST_CRONSCRIPT_DIR" ] || return |
301 |
+ if [ ! -d "${DST_CRONSCRIPT_DIR}" ]; then |
302 |
+ if [ "x${SKIP_CRON_WARNINGS}" != "xyes" ]; then |
303 |
+ ewarn "Automatic setup of cron jobs works only if a system cron daemon can use" |
304 |
+ ewarn "\${DST_CRONSCRIPT_DIR} (${DST_CRONSCRIPT_DIR}) as a spool directory" |
305 |
+ ewarn "(e.g. sys-process/vixie-cron can). On your system ${DST_CRONSCRIPT_DIR}" |
306 |
+ ewarn "is not a directory even, thus you need manually set the following cron jobs:" |
307 |
+ ewarn "*/5 * * * * root @PKGDATADIR@/scripts/vpsnetclean" |
308 |
+ ewarn "*/5 * * * * root @PKGDATADIR@/scripts/vpsreboot" |
309 |
+ ewarn "If you already did that and wish to avoid this warning put" |
310 |
+ ewarn "SKIP_CRON_WARNINGS=yes into /etc/conf.d/vz." |
311 |
+ fi |
312 |
+ return |
313 |
+ fi |
314 |
install -m644 -o root -g root $SRC_CRONSCRIPT_DIR/vz \ |
315 |
$DST_CRONSCRIPT_DIR |
316 |
} |
317 |
|
318 |
|
319 |
|
320 |
1.1 sys-cluster/vzctl/files/vzctl-3.0.23-UBC-parameter-swappages.patch |
321 |
|
322 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-UBC-parameter-swappages.patch?rev=1.1&view=markup |
323 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-UBC-parameter-swappages.patch?rev=1.1&content-type=text/plain |
324 |
|
325 |
Index: vzctl-3.0.23-UBC-parameter-swappages.patch |
326 |
=================================================================== |
327 |
From: Igor Sukhih <igor@××××××.org> |
328 |
Date: Tue, 10 Feb 2009 16:45:49 +0000 (+0300) |
329 |
Subject: Added new UBC parameter: swappages |
330 |
X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=6b819fb60634a109200b7a749aa40d595fcd4895 |
331 |
|
332 |
Added new UBC parameter: swappages |
333 |
|
334 |
[kir@××××××.org: man page modifications] |
335 |
--- |
336 |
|
337 |
diff --git a/include/ub.h b/include/ub.h |
338 |
index 35868aa..e6f0bf3 100644 |
339 |
--- a/include/ub.h |
340 |
+++ b/include/ub.h |
341 |
@@ -97,6 +97,9 @@ |
342 |
#ifndef UB_IPTENTRIES |
343 |
#define UB_IPTENTRIES 23 /* Number of iptables rules */ |
344 |
#endif |
345 |
+#ifndef UB_SWAPPAGES |
346 |
+#define UB_SWAPPAGES 24 |
347 |
+#endif |
348 |
#define UB_DUMMY 255 |
349 |
|
350 |
/** Data structure for UBC parameter. |
351 |
@@ -130,6 +133,7 @@ struct ub_struct { |
352 |
unsigned long *dcachesize; |
353 |
unsigned long *numiptent; |
354 |
unsigned long *avnumproc; |
355 |
+ unsigned long *swappages; |
356 |
}; |
357 |
typedef struct ub_struct ub_param; |
358 |
|
359 |
diff --git a/include/vzctl_param.h b/include/vzctl_param.h |
360 |
index 83919e8..afb8898 100644 |
361 |
--- a/include/vzctl_param.h |
362 |
+++ b/include/vzctl_param.h |
363 |
@@ -134,6 +134,7 @@ |
364 |
#define PARAM_NETIF_MAC_FILTER 360 |
365 |
#define PARAM_NETIF_BRIDGE 361 |
366 |
#define PARAM_DESCRIPTION 362 |
367 |
+#define PARAM_SWAPPAGES 363 |
368 |
|
369 |
#define PARAM_LINE "e:p:f:t:i:l:k:a:b:n:x:h" |
370 |
#endif |
371 |
diff --git a/man/vzctl.8 b/man/vzctl.8 |
372 |
index 92d49e3..01c9d59 100644 |
373 |
--- a/man/vzctl.8 |
374 |
+++ b/man/vzctl.8 |
375 |
@@ -315,6 +315,15 @@ This is currently an accounting-only parameter. It shows the usage of RAM |
376 |
by this container. Barrier should be set to 0, and limit should be set to |
377 |
\fBunlimited\fR. |
378 |
.TP |
379 |
+\fB--swappages\fR \fIpages\fR[:\fIpages\fR] |
380 |
+The limit, if set, is used to show a total amount of swap space available |
381 |
+inside the container. The barrier of this parameter is currently ignored. |
382 |
+The default value is \fBunlimited\fR, meaning total swap will be reported |
383 |
+as 0. |
384 |
+ |
385 |
+Note that in order for the value to be shown as total swap space, |
386 |
+\fB--meminfo\fR parameter should be set to value other than \fBnone\fR. |
387 |
+.TP |
388 |
\fBCPU fair scheduler parameters\fR |
389 |
|
390 |
These parameters control CPU usage by container. |
391 |
@@ -345,7 +354,8 @@ This parameter control output of /proc/meminfo inside a container |
392 |
No /proc/meminfo virtualization (the same as on host system). |
393 |
.IP "\fB--meminfo\fR \fImode\fR:\fIvalue\fR" |
394 |
Configure total memory output in a container. Reported free memory is evaluated |
395 |
-accordingly to the mode being set. |
396 |
+accordingly to the mode being set. Reported swap is evaluated |
397 |
+according to the settings of \fB--swappages\fR parameter. |
398 |
.br |
399 |
You can use the following modes for \fImode\fR: |
400 |
.br |
401 |
diff --git a/src/lib/config.c b/src/lib/config.c |
402 |
index bb8953f..a16fe54 100644 |
403 |
--- a/src/lib/config.c |
404 |
+++ b/src/lib/config.c |
405 |
@@ -83,6 +83,7 @@ static vps_config config[] = { |
406 |
{"NUMIPTENT", NULL, PARAM_NUMIPTENT}, |
407 |
{"IPTENTRIES", "NUMIPTENT", -1}, |
408 |
{"AVNUMPROC", NULL, PARAM_AVNUMPROC}, |
409 |
+{"SWAPPAGES", NULL, PARAM_SWAPPAGES}, |
410 |
/* Capability */ |
411 |
{"CAPABILITY", NULL, PARAM_CAP}, |
412 |
/* Network */ |
413 |
@@ -163,6 +164,7 @@ static struct option set_opt[] = { |
414 |
{"dcachesize", required_argument, NULL, PARAM_DCACHESIZE}, |
415 |
{"numiptent", required_argument, NULL, PARAM_NUMIPTENT}, |
416 |
{"avnumproc", required_argument, NULL, PARAM_AVNUMPROC}, |
417 |
+{"swappages", required_argument, NULL, PARAM_SWAPPAGES}, |
418 |
/* Capability */ |
419 |
{"capability", required_argument, NULL, PARAM_CAP}, |
420 |
/* Network */ |
421 |
@@ -685,6 +687,7 @@ if (ub->res != NULL) { \ |
422 |
ADD_UB_PARAM(dcachesize, PARAM_DCACHESIZE) |
423 |
ADD_UB_PARAM(numiptent, PARAM_NUMIPTENT) |
424 |
ADD_UB_PARAM(avnumproc, PARAM_AVNUMPROC) |
425 |
+ ADD_UB_PARAM(swappages, PARAM_SWAPPAGES) |
426 |
#undef ADD_UB_PARAM |
427 |
|
428 |
return 0; |
429 |
@@ -1933,6 +1936,7 @@ static int parse(envid_t veid, vps_param *vps_p, char *val, int id) |
430 |
case PARAM_PHYSPAGES: |
431 |
case PARAM_VMGUARPAGES: |
432 |
case PARAM_OOMGUARPAGES: |
433 |
+ case PARAM_SWAPPAGES: |
434 |
ret = parse_ub(vps_p, val, id, _page_size); |
435 |
break; |
436 |
case PARAM_NUMPROC: |
437 |
diff --git a/src/lib/ub.c b/src/lib/ub.c |
438 |
index a50a1dc..f25522f 100644 |
439 |
--- a/src/lib/ub.c |
440 |
+++ b/src/lib/ub.c |
441 |
@@ -61,6 +61,7 @@ static struct ubname2id { |
442 |
{"DCACHESIZE", PARAM_DCACHESIZE}, |
443 |
{"NUMIPTENT", PARAM_NUMIPTENT}, |
444 |
{"AVNUMPROC", PARAM_AVNUMPROC}, |
445 |
+ {"SWAPPAGES", PARAM_SWAPPAGES}, |
446 |
{NULL, 0}, |
447 |
}; |
448 |
|
449 |
@@ -128,6 +129,7 @@ inline static int is_ub_empty(ub_param *ub) |
450 |
CHECK_UB(numfile) |
451 |
CHECK_UB(dcachesize) |
452 |
CHECK_UB(numiptent) |
453 |
+ CHECK_UB(swappages) |
454 |
#undef CHECK_UB |
455 |
|
456 |
return 1; |
457 |
@@ -185,6 +187,16 @@ if (ub->name != NULL) { \ |
458 |
SET_UB_LIMIT(numfile, UB_NUMFILE) |
459 |
SET_UB_LIMIT(dcachesize, UB_DCACHESIZE) |
460 |
SET_UB_LIMIT(numiptent, UB_IPTENTRIES) |
461 |
+ if (ub->swappages && |
462 |
+ setublimit(veid, UB_SWAPPAGES, ub->swappages) == -1) |
463 |
+ { |
464 |
+ if (errno == EINVAL) { |
465 |
+ logger(-1, ENOSYS, "failed to set swappages"); |
466 |
+ } else { |
467 |
+ logger(-1, errno, "failed to set swappages"); |
468 |
+ return VZ_SETUBC_ERROR; |
469 |
+ } |
470 |
+ } |
471 |
#undef SET_UB_LIMIT |
472 |
|
473 |
return 0; |
474 |
@@ -327,6 +339,7 @@ if ((src->x) != NULL) { \ |
475 |
MERGE_P2(dcachesize) |
476 |
MERGE_P2(numiptent) |
477 |
MERGE_P2(avnumproc) |
478 |
+ MERGE_P2(swappages) |
479 |
#undef MERGE_P2 |
480 |
} |
481 |
|
482 |
diff --git a/src/vzctl.c b/src/vzctl.c |
483 |
index 448b83a..58715ae 100644 |
484 |
--- a/src/vzctl.c |
485 |
+++ b/src/vzctl.c |
486 |
@@ -91,7 +91,9 @@ void usage(int rc) |
487 |
" --oomguarpages P[:P] --lockedpages P[:P] --privvmpages P[:P]\n" |
488 |
" --shmpages P[:P] --numfile N[:N] --numflock N[:N]\n" |
489 |
" --numpty N[:N] --numsiginfo N[:N] --dcachesize N[:N]\n" |
490 |
-" --numiptent N[:N] --physpages P[:P] --avnumproc N[:N]\n"); |
491 |
+" --numiptent N[:N] --physpages P[:P] --avnumproc N[:N]\n" |
492 |
+" --swappages P[:P]\n" |
493 |
+); |
494 |
memset(&mod, 0, sizeof(mod)); |
495 |
set_log_level(0); |
496 |
init_modules(&mod, NULL); |
497 |
|
498 |
|
499 |
|
500 |
1.1 sys-cluster/vzctl/files/vzctl-3.0.23-forwarding-issue-warning.patch |
501 |
|
502 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-forwarding-issue-warning.patch?rev=1.1&view=markup |
503 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-forwarding-issue-warning.patch?rev=1.1&content-type=text/plain |
504 |
|
505 |
Index: vzctl-3.0.23-forwarding-issue-warning.patch |
506 |
=================================================================== |
507 |
commit 78ef67a523e7f2589e49a082376ee56ce1a5d76e |
508 |
Author: Peter Volkov <pva@g.o> |
509 |
Date: Tue Mar 31 13:03:44 2009 +0400 |
510 |
|
511 |
Issue warning if forwarding is disabled |
512 |
|
513 |
In case forwarding is disabled let's warn user about that. This is |
514 |
alternative solution for http://bugzilla.openvz.org/show_bug.cgi?id=1079 |
515 |
|
516 |
diff --git a/etc/init.d/vz-gentoo.in b/etc/init.d/vz-gentoo.in |
517 |
index dc87d41..7c57370 100755 |
518 |
--- a/etc/init.d/vz-gentoo.in |
519 |
+++ b/etc/init.d/vz-gentoo.in |
520 |
@@ -128,6 +128,11 @@ start_net() { |
521 |
ebegin "Configuring interface ${VZDEV}" |
522 |
/sbin/sysctl -q -w net.ipv4.conf.${VZDEV}.send_redirects=0 |
523 |
eend $? |
524 |
+ |
525 |
+ if [ "x$(/sbin/sysctl net.ipv4.ip_forward 2>/dev/null | awk '{print $3}')" = "x0" ]; then |
526 |
+ ewarn "It looks like you have ip forwarding disabled. To make networking" |
527 |
+ ewarn "available for containers, please, run sysctl -w net.ipv4.ip_forward=1" |
528 |
+ fi |
529 |
} |
530 |
|
531 |
stop_net() { |
532 |
|
533 |
|
534 |
|
535 |
1.1 sys-cluster/vzctl/files/vzctl-3.0.23-vzarp-on-ifup.patch |
536 |
|
537 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-vzarp-on-ifup.patch?rev=1.1&view=markup |
538 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-vzarp-on-ifup.patch?rev=1.1&content-type=text/plain |
539 |
|
540 |
Index: vzctl-3.0.23-vzarp-on-ifup.patch |
541 |
=================================================================== |
542 |
http://556.bugzilla.openvz.org/attachment.cgi?id=829 |
543 |
|
544 |
We need to test this patch. Hey, anybody? |
545 |
|
546 |
diff --git a/Makefile.am b/Makefile.am |
547 |
index 3b67cd8..ae05b3b 100644 |
548 |
--- a/Makefile.am |
549 |
+++ b/Makefile.am |
550 |
@@ -53,6 +53,7 @@ DISTRO_TARGETS = \ |
551 |
|
552 |
$(DISTRO_TARGETS): |
553 |
$(MAKE) $(AM_MAKEFLAGS) -C etc $@ |
554 |
+ $(MAKE) $(AM_MAKEFLAGS) -C scripts $@ |
555 |
|
556 |
install-data-hook: |
557 |
@echo |
558 |
diff --git a/scripts/Makefile.am b/scripts/Makefile.am |
559 |
index a2bde7e..85ea8fd 100644 |
560 |
--- a/scripts/Makefile.am |
561 |
+++ b/scripts/Makefile.am |
562 |
@@ -22,7 +22,8 @@ vzlib_SCRIPTS = \ |
563 |
vps-functions \ |
564 |
vps-net_add \ |
565 |
vps-net_del \ |
566 |
- vps-stop |
567 |
+ vps-stop \ |
568 |
+ ifup-vz-arp |
569 |
|
570 |
vzcron_SCRIPTS = \ |
571 |
vpsnetclean \ |
572 |
@@ -35,3 +36,36 @@ EXTRA_DIST = \ |
573 |
CLEANFILES = \ |
574 |
$(vzlib_SCRIPTS) \ |
575 |
$(vzcron_SCRIPTS) |
576 |
+ |
577 |
+# FIXME: what to do in case DESTDIR is set? I guess nothing... |
578 |
+install-redhat: |
579 |
+ if [ ! -e /sbin/ifup-local ]; then \ |
580 |
+ ln -sf @PKGLIBDIR@/scripts/ifup-vz-arp /sbin/ifup-local; \ |
581 |
+ else \ |
582 |
+ @echo; \ |
583 |
+ @echo " ***************************************************"; \ |
584 |
+ @echo " WARNING: /sbin/ifup-local is present!"; \ |
585 |
+ @echo " You have to manually edit /sbin/ifup-local so that "; \ |
586 |
+ @echo " @PKGLIBDIR@/scripts/ifup-vz-arp"; \ |
587 |
+ @echo " is called from it."; \ |
588 |
+ @echo " ***************************************************"; \ |
589 |
+ @echo; \ |
590 |
+ fi |
591 |
+ |
592 |
+ |
593 |
+install-suse: |
594 |
+ ln -sf @PKGLIBDIR@/scripts/ifup-vz-arp /etc/sysconfig/network/if-up.d/ |
595 |
+ |
596 |
+install-debian: |
597 |
+ ln -sf @PKGLIBDIR@/scripts/ifup-vz-arp /etc/network/if-up.d/ |
598 |
+ |
599 |
+install-gentoo: |
600 |
+ @echo |
601 |
+ @echo " ***************************************************" |
602 |
+ @echo " Please add the following code to /etc/conf.d/net:" |
603 |
+ @echo |
604 |
+ @echo "postup() {" |
605 |
+ @echo " @PKGLIBDIR@/scripts/ifup-vz-arp" '"${IFACE}"' |
606 |
+ @echo "}" |
607 |
+ @echo " ***************************************************" |
608 |
+ @echo |
609 |
diff --git a/scripts/ifup-vz-arp.in b/scripts/ifup-vz-arp.in |
610 |
new file mode 100755 |
611 |
index 0000000..7e2346b |
612 |
--- /dev/null |
613 |
+++ b/scripts/ifup-vz-arp.in |
614 |
@@ -0,0 +1,25 @@ |
615 |
+#!/bin/bash |
616 |
+# Copyright (C) 2008, Parallels, Inc. All rights reserved. |
617 |
+# |
618 |
+# Update ARP table for all containers on interface up |
619 |
+ |
620 |
+[ ! -f /proc/vz/veinfo ] && exit 0 |
621 |
+ |
622 |
+test -f @PKGLIBDIR@/scripts/vps-functions || exit 1 |
623 |
+test -f @PKGCONFDIR@/vz.conf || exit 1 |
624 |
+. @PKGLIBDIR@/scripts/vps-functions |
625 |
+. @PKGCONFDIR@/vz.conf |
626 |
+ |
627 |
+update_arp() |
628 |
+{ |
629 |
+ local veip |
630 |
+ for veip in $(awk '!/^Version/ { print $1 }' /proc/vz/veip); do |
631 |
+ vzarp add ${veip} |
632 |
+ done |
633 |
+} |
634 |
+ |
635 |
+DEV=$1 |
636 |
+[ -z "${DEV}" ] && exit 0 |
637 |
+NETDEVICES="${DEV}" |
638 |
+update_arp |
639 |
+exit 0 |
640 |
diff --git a/vzctl.spec b/vzctl.spec |
641 |
index ae3ed8c..adc6702 100644 |
642 |
--- a/vzctl.spec |
643 |
+++ b/vzctl.spec |
644 |
@@ -108,6 +108,7 @@ rm -rf $RPM_BUILD_ROOT |
645 |
%attr(755,root,root) %{_sbindir}/vzmigrate |
646 |
%attr(755,root,root) %{_scriptdir}/vpsreboot |
647 |
%attr(755,root,root) %{_scriptdir}/vpsnetclean |
648 |
+%attr(755,root,root) %{_scriptdir}/ifup-vz-arp |
649 |
%attr(644,root,root) %{_logrdir}/vzctl |
650 |
%attr(644,root,root) %{_distconfdir}/distribution.conf-template |
651 |
%attr(644,root,root) %{_distconfdir}/default |
652 |
@@ -161,6 +162,11 @@ if [ -f /etc/SuSE-release ]; then |
653 |
for file in ${NET_CFG}; do |
654 |
ln -sf /etc/sysconfig/network-scripts/${file} /etc/sysconfig/network/scripts/${file} |
655 |
done |
656 |
+ ln -sf /usr/share/vzctl/scripts/ifup-vz-arp /etc/sysconfig/network/if-up.d/ifup-arp |
657 |
+else # RedHat/Fedora/CentOS case |
658 |
+ if [ ! -e /sbin/ifup-local ]; then |
659 |
+ ln -sf /usr/share/vzctl/scripts/ifup-vz-arp /sbin/ifup-local |
660 |
+ fi |
661 |
fi |
662 |
|
663 |
%preun |
664 |
|
665 |
|
666 |
|
667 |
1.1 sys-cluster/vzctl/files/vzctl-3.0.23-ppp-feature.patch |
668 |
|
669 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-ppp-feature.patch?rev=1.1&view=markup |
670 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-ppp-feature.patch?rev=1.1&content-type=text/plain |
671 |
|
672 |
Index: vzctl-3.0.23-ppp-feature.patch |
673 |
=================================================================== |
674 |
From: Cyrill Gorcunov <gorcunov@××××××.org> |
675 |
Date: Tue, 3 Feb 2009 19:45:36 +0000 (+0300) |
676 |
Subject: Introduce new "ppp" feature |
677 |
X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=d78a7653d983269553763d536f69de0bb5109353 |
678 |
|
679 |
Introduce new "ppp" feature |
680 |
|
681 |
Allow an user to turn "ppp" feature on and off. |
682 |
|
683 |
Signed-off-by: Cyrill Gorcunov <gorcunov@××××××.org> |
684 |
--- |
685 |
|
686 |
diff --git a/include/linux/vzcalluser.h b/include/linux/vzcalluser.h |
687 |
index 045a0e1..66d61cd 100644 |
688 |
--- a/include/linux/vzcalluser.h |
689 |
+++ b/include/linux/vzcalluser.h |
690 |
@@ -202,6 +202,7 @@ struct env_create_param3 { |
691 |
#define VE_FEATURE_DEF_PERMS (1ULL << 2) |
692 |
#define VE_FEATURE_SIT (1ULL << 3) |
693 |
#define VE_FEATURE_IPIP (1ULL << 4) |
694 |
+#define VE_FEATURE_PPP (1ULL << 5) |
695 |
|
696 |
#define VE_FEATURES_OLD (VE_FEATURE_SYSFS) |
697 |
#define VE_FEATURES_DEF (VE_FEATURE_SYSFS | \ |
698 |
diff --git a/man/vzctl.8 b/man/vzctl.8 |
699 |
index 85d3b0d..92d49e3 100644 |
700 |
--- a/man/vzctl.8 |
701 |
+++ b/man/vzctl.8 |
702 |
@@ -446,7 +446,7 @@ designated by its \fImajor\fR and \fIminor\fR numbers. Device file have to be cr |
703 |
.TP |
704 |
\fB--features\fR \fIname\fR:\fBon|off\fR |
705 |
Enable or disable a specific container feature. |
706 |
-Known features are: \fIsysfs\fR, \fInfs\fR, \fIsit\fR, \fIipip\fR. |
707 |
+Known features are: \fIsysfs\fR, \fInfs\fR, \fIsit\fR, \fIipip\fR, \fIppp\fR. |
708 |
.TP |
709 |
\fBApply config\fR |
710 |
.TP |
711 |
diff --git a/src/lib/vzfeatures.c b/src/lib/vzfeatures.c |
712 |
index 2f5596a..c6af929 100644 |
713 |
--- a/src/lib/vzfeatures.c |
714 |
+++ b/src/lib/vzfeatures.c |
715 |
@@ -27,6 +27,7 @@ static struct feature_s features[] = { |
716 |
{ "nfs", 0, VE_FEATURE_NFS }, |
717 |
{ "sit", 0, VE_FEATURE_SIT}, |
718 |
{ "ipip", 0, VE_FEATURE_IPIP}, |
719 |
+ { "ppp", 0, VE_FEATURE_PPP}, |
720 |
{ NULL} |
721 |
}; |
722 |
|
723 |
|
724 |
|
725 |
|
726 |
1.1 sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-typo-fix.patch |
727 |
|
728 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-typo-fix.patch?rev=1.1&view=markup |
729 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-cronjobs-typo-fix.patch?rev=1.1&content-type=text/plain |
730 |
|
731 |
Index: vzctl-3.0.23-cronjobs-typo-fix.patch |
732 |
=================================================================== |
733 |
commit b57ce68fae2ce2642a36746b8e7b7216a02bfc8c |
734 |
Author: Peter Volkov <pva@g.o> |
735 |
Date: Sun Feb 22 19:40:34 2009 +0300 |
736 |
|
737 |
vz-gentoo.in typo: check for DST_CRONSCRIPT_DIR |
738 |
|
739 |
Fixed indentation and typo to make script really check for |
740 |
$DST_CRONSCRIPT_DIR directory existence. |
741 |
|
742 |
diff --git a/etc/init.d/vz-gentoo.in b/etc/init.d/vz-gentoo.in |
743 |
index 005813f..97ea313 100755 |
744 |
--- a/etc/init.d/vz-gentoo.in |
745 |
+++ b/etc/init.d/vz-gentoo.in |
746 |
@@ -56,17 +56,17 @@ check_config() { |
747 |
# being enabled or not. |
748 |
setup_cron() |
749 |
{ |
750 |
- [ -z "$SRC_CRONSCRIPT_DIR" ] && return |
751 |
- [ -d "$SRC_CRONSCRIPT_DIR" ] || return |
752 |
- install -m644 -o root -g root $SRC_CRONSCRIPT_DIR/vz \ |
753 |
- $DST_CRONSCRIPT_DIR |
754 |
+ [ -z "$SRC_CRONSCRIPT_DIR" ] && return |
755 |
+ [ -d "$DST_CRONSCRIPT_DIR" ] || return |
756 |
+ install -m644 -o root -g root $SRC_CRONSCRIPT_DIR/vz \ |
757 |
+ $DST_CRONSCRIPT_DIR |
758 |
} |
759 |
|
760 |
remove_cron() |
761 |
{ |
762 |
- [ -z "$SRC_CRONSCRIPT_DIR" ] && return |
763 |
- [ -d "$SRC_CRONSCRIPT_DIR" ] || return |
764 |
- cat > $DST_CRONSCRIPT_DIR/vz <<EOF |
765 |
+ [ -z "$SRC_CRONSCRIPT_DIR" ] && return |
766 |
+ [ -d "$DST_CRONSCRIPT_DIR" ] || return |
767 |
+ cat > $DST_CRONSCRIPT_DIR/vz <<EOF |
768 |
# DO NOT EDIT THIS FILE! |
769 |
# |
770 |
# Contents of this file managed by /etc/init.d/vz script |
771 |
|
772 |
|
773 |
|
774 |
1.1 sys-cluster/vzctl/files/vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch |
775 |
|
776 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch?rev=1.1&view=markup |
777 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch?rev=1.1&content-type=text/plain |
778 |
|
779 |
Index: vzctl-3.0.23-vznetaddbr.in-no-bashisms.patch |
780 |
=================================================================== |
781 |
From: Dmitry V. Levin <ldv@××××××××.org> |
782 |
Date: Fri, 31 Oct 2008 11:54:47 +0000 (+0000) |
783 |
Subject: vznetaddbr.in: Rewrite without bash-isms and ifconfig |
784 |
X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=93ef4d978a8c609cc04c53f39bc4fe674a089811 |
785 |
|
786 |
vznetaddbr.in: Rewrite without bash-isms and ifconfig |
787 |
|
788 |
Signed-off-by: Dmitry V. Levin <ldv@××××××××.org> |
789 |
--- |
790 |
|
791 |
diff --git a/bin/vznetaddbr.in b/bin/vznetaddbr.in |
792 |
index eb2ba70..e8599e9 100755 |
793 |
--- a/bin/vznetaddbr.in |
794 |
+++ b/bin/vznetaddbr.in |
795 |
@@ -1,53 +1,39 @@ |
796 |
-#!/bin/bash |
797 |
+#!/bin/sh |
798 |
# |
799 |
# Add virtual network interfaces (veth's) in a container to a bridge on CT0 |
800 |
|
801 |
CONFIGFILE=@PKGCONFDIR@/conf/$VEID.conf |
802 |
. $CONFIGFILE |
803 |
|
804 |
-NETIFLIST=$(echo $NETIF | sed 's/;/\n/g') |
805 |
+NETIFLIST=$(printf %s "$NETIF" |tr ';' '\n') |
806 |
|
807 |
-if [ ! -n "$NETIFLIST" ]; then |
808 |
- echo "According to $CONFIGFILE, CT$VEID has no veth interface configured." |
809 |
+if [ -z "$NETIFLIST" ]; then |
810 |
+ echo >&2 "According to $CONFIGFILE, CT$VEID has no veth interface configured." |
811 |
exit 1 |
812 |
fi |
813 |
|
814 |
-IFACES=$(echo $NETIFLIST | sed 's/;/\n/g') |
815 |
-for tmp in $IFACES; do |
816 |
- CTIFNAME= |
817 |
- CTBRIDGE= |
818 |
- VZHOSTIF= |
819 |
- |
820 |
- NETIF_OPTIONS=$(echo $tmp | sed 's/,/\n/g') |
821 |
- for str in $NETIF_OPTIONS; do |
822 |
- # getting 'ifname' parameter value |
823 |
- if [[ "$str" =~ ^ifname= ]]; then |
824 |
- # remove the parameter name from the string (along with '=') |
825 |
- CTIFNAME=${str#*=} |
826 |
- fi |
827 |
- if [[ "$str" =~ ^bridge= ]]; then |
828 |
- # remove the parameter name from the string (along with '=') |
829 |
- CTBRIDGE=${str#*=} |
830 |
- fi |
831 |
- # getting 'host_ifname' parameter value |
832 |
- if [[ "$str" =~ ^host_ifname= ]]; then |
833 |
- # remove the parameter name from the string (along with '=') |
834 |
- VZHOSTIF=${str#*=} |
835 |
- fi |
836 |
+for iface in $NETIFLIST; do |
837 |
+ bridge= |
838 |
+ host_ifname= |
839 |
+ |
840 |
+ for str in $(printf %s "$iface" |tr ',' '\n'); do |
841 |
+ case "$str" in |
842 |
+ bridge=*|host_ifname=*) |
843 |
+ eval "${str%%=*}=\${str#*=}" ;; |
844 |
+ esac |
845 |
done |
846 |
|
847 |
- if [ "$VZHOSTIF" != "$3" ]; then |
848 |
- continue |
849 |
- fi |
850 |
- if [ ! -n "$CTBRIDGE" ]; then |
851 |
- CTBRIDGE=vmbr0 |
852 |
- fi |
853 |
- |
854 |
- echo "Adding interface $VZHOSTIF to bridge $CTBRIDGE on CT0 for CT$VEID" |
855 |
- /sbin/ifconfig $VZHOSTIF 0 |
856 |
- echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/proxy_arp |
857 |
- echo 1 > /proc/sys/net/ipv4/conf/$VZHOSTIF/forwarding |
858 |
- /usr/sbin/brctl addif $CTBRIDGE $VZHOSTIF |
859 |
+ [ "$host_ifname" = "$3" ] || |
860 |
+ continue |
861 |
+ |
862 |
+ [ -n "$bridge" ] || |
863 |
+ bridge=vmbr0 |
864 |
+ |
865 |
+ echo "Adding interface $host_ifname to bridge $bridge on CT0 for CT$VEID" |
866 |
+ ip addr add 0 dev "$host_ifname" |
867 |
+ echo 1 >"/proc/sys/net/ipv4/conf/$host_ifname/proxy_arp" |
868 |
+ echo 1 >"/proc/sys/net/ipv4/conf/$host_ifname/forwarding" |
869 |
+ brctl addif "$bridge" "$host_ifname" |
870 |
|
871 |
break |
872 |
done |
873 |
|
874 |
|
875 |
|
876 |
1.1 sys-cluster/vzctl/files/vzctl-3.0.23-debian-CT-ipv6-fix.patch |
877 |
|
878 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-debian-CT-ipv6-fix.patch?rev=1.1&view=markup |
879 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-cluster/vzctl/files/vzctl-3.0.23-debian-CT-ipv6-fix.patch?rev=1.1&content-type=text/plain |
880 |
|
881 |
Index: vzctl-3.0.23-debian-CT-ipv6-fix.patch |
882 |
=================================================================== |
883 |
From: mathgl <mathgl@××××××××.fr> |
884 |
Date: Mon, 17 Nov 2008 18:27:19 +0000 (+0300) |
885 |
Subject: Fix IPv6 configuration on a debian lenny container |
886 |
X-Git-Url: http://git.openvz.org/?p=vzctl;a=commitdiff_plain;h=9fe02f4a9a42d8d608c401d2508da01f2a07a13e |
887 |
|
888 |
Fix IPv6 configuration on a debian lenny container |
889 |
|
890 |
http://bugzilla.openvz.org/show_bug.cgi?id=824 |
891 |
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=505792 |
892 |
--- |
893 |
|
894 |
diff --git a/etc/dists/scripts/debian-add_ip.sh b/etc/dists/scripts/debian-add_ip.sh |
895 |
index ca87137..b9bda3e 100755 |
896 |
--- a/etc/dists/scripts/debian-add_ip.sh |
897 |
+++ b/etc/dists/scripts/debian-add_ip.sh |
898 |
@@ -79,7 +79,7 @@ iface ${VENET_DEV}:${ifnum} inet static |
899 |
" >> ${CFGFILE}.bak |
900 |
|
901 |
else |
902 |
- sed -i -e "s/netmask\ 128/netmask\ 128\n\tup ifconfig venet0 add ${ip}/" ${CFGFILE}.bak |
903 |
+ sed -i -e "s/netmask\ 128/netmask\ 128\n\tup ifconfig venet0 add ${ip}\/0/" ${CFGFILE}.bak |
904 |
fi |
905 |
|
906 |
} |