Released vzctl-3.0.26.2This is a next stable update to 3.0.26, fixing the following regressions:
* 'test: integer expression expected' error from vz initscript (#1806)
* vzctl runscript: fix logic in case container is stopped
In addition, it fixes the following bug (not a regression):
* vzctl exec: fix for bash-4.2 (#1812)
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl exec: fix for bash-4.2Just before exec'ing bash we need to close all fds
except for stdin/out/err. Earlier versions of bash did that
for us so the bug went unnoticed.
http://bugzilla.openvz.org/1812
Reported-by: michaelk@linuxmail.org
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
(cherry picked from commit e7c40ee697606e43d6242fd3c124e370588ae26f)
vps_run_script(): do not leak opened fdsClose all opened fds, keep your country tidy.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
(cherry picked from commit 20256d0c0c07278bd5ed5c7f954046a63db1f37f)
vzctl runscript: fix logicCommit fd657abf12 changed the logic of handling wait_p file descriptor,
but vps_run_script() was not changed to reflect the logic. So, now when
a container is not running and we execute vzctl runscript, it ends up
being half-started.
Fix it.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
(cherry picked from commit 49bff887b543adf0dd349ccbd3756efbe4663497)
vps_run_script(): fix arguments for vz_env_create()Commit c4fd52f7 added an extra argument to vz_env_create(),
but incorrectly patched vps_run_script(). Fix it.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
(cherry picked from commit 8f5e6fa0bce93b6ef19af4fe828799eb3ca2b37c)
etc/init.d/vz*: more proper kernel check in modify_vzconf()For now, the only VSwap-capable kernel is 042{test,stab}.
Currently all the kernels that do not have stab or test in their name
(ie in /proc/vz/version) are definitely not VSwap-capable. If they
ever will be we will need to modify this check.
Add the check for 'test|stab' to avoid the following error while
starting vz initscript:
/etc/init.d/vz: line 163: test: dzhanibekov: integer expressi...
Released vzctl-3.0.26.1This is a stable update to 3.0.26, fixing the following regression:
* debian ip add script broken - network unavilable (#1792, #1669)
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
etc/dists/scripts/debian-add_ip.sh: fix not adding default routeThis fixes the problem of non-working network in Debian and Ubuntu
containers after upgrade to vzctl-3.0.26, caused by commit 9612a0121.
Apparently, older kernels (like 2.6.18) are refusing to add default
route for a device with no IP addresses. Such problem does not exist
with RHEL6 based (2.6.32) kernel, but RHEL5-based kernels (2.6.18)
are failing miserably.
The workaround is to use 'ifcon...
Released vzctl 3.0.26CHANGES
(since 3.0.25.2)
New features
* vzctl set: add cpu bindings (--cpumask)
* etc/conf: add vswap configs
* etc/init.d/vz*: switch default CT config to vswap if supported
* vzctl set --pci*: use newer kernel API
* etc/vz.conf: enable IPv6 by default (#651)
Fixes
* vzctl start: do not start half-configured environment (#1732)
* vzctl restore: support both old and new kernel lockfd api (#17...
vzctl create: warn if default sample is not to be usedIn case CT config already exists, a default configuration sample (the one
specified as CONFIGFILE in vz.conf) is not being used. This is aimed at
advanced user who knows what to do.
Still, some people mistakenly set a few CT parameters before vzctl create,
and it ends up with incomplete config (and inability to start).
For those, emit the following helpful warning:
Warning: CT config file a...
vzctl create: exit with error if default CT config not foundIt was discovered that vzctl create tolerates invalid setting of CONFIGFILE
in /etc/vz/vz.conf and just silently creates a container with unusable
configuration file.
Fix it by explicitly checking that config sample exists, and error out
if it's not, giving a user a helpful hint of what's wrong, like this:
# vzctl create 21342134
File /etc/vz/conf/ve-something.conf-sample not found: No such...
etc/init.d/vz-*: fix for previous kludge.Commit 39bdf8e401 added a kludge to modify default CONFIGFILE
for vswap-enabled kernel (and warn a user about it). The problem
is such warning is printed every time (on a vswap-enabled kernel)
regardless of whether we actually modify vz.conf or not.
Fix it. While at it, make the code more simple/generic.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl restore: CPT_UNDUMP may return positive valueWhen vzctl writes something to CPT_LOCKFD, the kernel reads data
from this file descriptor and should return an error (negative value),
but instead it returns code from read() (naturally, positive value).
This kernel bug exists in old kernels (every one except rhel6 < 042test008).
Indeed, this is the bug in the kernel, so this patch is a workaround for it.
Instead of checking for negative val...
vzctl restore: support old and new interface of cpt lockfilesThe small historical reference about new semantic of wait_p:
commit fd657abf122caee09189b115f116c9d089695991
Author: Kir Kolyshkin <kir@openvz.org>
Date: Wed Jan 12 16:14:58 2011 +0300
That "OK to go" signal is closing a specific file descriptor
without sending anything via it, while "no go" signal is sending some
error code. The problem is in case the parent segfaults, the kern...
etc/dists/scripts/debian-add_ip.sh: remove venet0 completely if no IPs to addWhen IPDELALL is set and IP_ADDR is empty, remove venet0 completely
from /etc/network/interfaces, so there will be no default route etc.
If IP_ADDR is not empty, only remove IP addresses and leave the main
venet0 section intact.
Should fix bug #1669.
http://bugzilla.openvz.org/1669
Reported-by: Olena Vasilkova <daemon@root.ua>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
etc/dists/scripts/debian-add_ip.sh: improve removing of IPv6 addressCommit 9612a0121 changed the logic of adding an IPv6 address to Debian CT.
This patch adds some enhancements to it:
- adding a comment telling what we do
- make the grep regex stricter: we want the line to start with a tab
and a space after add/del
- also remove "down ifconfig venet0 del" line which was not removed
http://bugzilla.openvz.org/1669
Cc: Michael Fincham <michael@unleash.co....
etc/dists/scripts/debian-add_ip.sh: remove all traces of venet0When starting a container with no IP addresses configured, make
sure to remove everything about venet0 from /etc/network/interfaces.
Before this patch, we only checked if there are aliases
(like venet0:1), but not for venet0 itself. Now we check
both for venet0 and its aliases.
This is part of the fix for bug #1596.
http://bugzilla.openvz.org/1596
Reported-by: Olena Vasilkova <daemon@root.u...
etc/dists/scripts/debian-*_ip.sh: remove hardcoded namesSpotted a few places where hardcoded names are used instead of variables.
Fix it.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
src/lib/config.c: declare some functions as staticAlso, remove one unused function. It was meant to implement
the 'vzctl unset' functionality, but we will do it in a different way.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
veth: added hint to load vzethdevIn case vzctl fails to configure veth device because kernel returns
ENOTTY from VETHCTL_VE_HWADDR ioctl(), this means kernel doesn't know
anything about veth. Most common reason (for recent kernel) is that
kernel module is not loaded -- give a user a hint about it.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzctl chkpnt: fix a code pathCommit 16ee8dd9 forgot to add curly braces for an if statement.
Cc: Andrey Vagin <agavin@openvz.org
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vznetaddbr: fix interface initializationInitially, we used "ifconfig $if 0" to initialize veth interface.
Commit 93ef4d978 changed that to using "ip a a 0 dev $ifname" which
looks like full analog of previous ifconfig, but lead to bug #1089
reported.
Next, commit 77631ba55 (ironically with the same same subject as this one)
changed "ip a a 0 dev $if" to "ip link set dev $if up". This probably
fixed bug #1089, but lead to opening a ...
vzmemcheck: fix output formattingIn case -vA options are used, last line was printed with a skew:
-------------------------------------------------------------------------
Summary: 16.49 169.15 107.53 107.53 907.15 256.47 1117.15 2491.70
1201.00 1201.00 3004.00 3977.00 3977.00 3977.00 3977.00 3977.00
Fix it, and also add one missing dash.
After this patch, it looks like it should:
---------------------------...
calc_hn_rusage(): only account for running containers.While it is usually not the case, sometimes /proc/user_beancounters contains
values from the old (not currently running) containers. There are a few reasons
why it can be the case, with the most common being a kernel bug.
Nevertheless, calc_hn_rusage() should not use beancounters for not running
CTs. We do so by getting a list of running CTs first, and then for every UBC
check that such UBC ID...
vzmemcheck: only account for running containers.While it is usually not the case, sometimes /proc/user_beancounters contains
values from the old (not currently running) containers. There are a few reasons
why it can be the case, with the most common being a kernel bug.
Nevertheless, vzmemcheck should not use beancounters for not running CTs.
We do so by getting a list of running CTs first, and then for every UBC
check that such UBC ID exist...
util.c: introduce get_running_ve_list(), ve_in_list() functionsThose are to be used to fix bug #1757.
http://bugzilla.openvz.org/1757
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
build system: fix make distCommit 3866be1b709 broke 'make dist' target -- etc/conf/*.conf files
were not included into tarball. Fix it.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vzifup-post: fix device for proxy arpWe need to del/add routing to detect correct device for proxy arp in
NEIGHBOUR_DEVS=detect mode.
http://bugzilla.openvz.org/show_bug.cgi?id=1587
build system: fix generated files' permsIt is more convenient for developers if all the generated files
have the same permissions as their .in ancestors. It's a not a big
deal per se because 'make install' takes care about proper permissions.
Use chmod --reference to do that, and ignore the error if it doesn't work
(for example when 'chmod' don't understand '--reference' option).
Reported-by: Andrey Vagin <avagin@openvz.org>
Signed...
etc/vz.conf: enable IPv6 by defaultThere is no reason to keep it disabled by default.
http://bugzilla.openvz.org/651
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
src/lib/cpt.c: fix a function nameThere was a typo in function name. Fix it, just for the sake
of aesthetics. While at it, change FN to lowercase.
Should not have any visible effect.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
man/vzlist.8: improve the description of -S optionOption -S, --stopped actually means 'non-running', so let's
make it clear in the man page.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
bash-completion: for restore, show only suspended CTsWhen completing CT IDs and names for vzctl restore, only show
CTs what have a status of suspended. Unfortunately vzlist doesn't have
the ability to filter out CTs by status (except for running/stopped/all),
so we have to use grep/sed trickery.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
src/vzlist.c: remove dead codeAfter commit 69417764 we have the following warnings:
CC vzlist.o
vzlist.c:825:14: warning: ‘parse_var’ defined but not used
vzlist.c:1075:14: warning: ‘remove_sp’ defined but not used
vzlist.c:1357:12: warning: ‘get_stop_quota_stats’ defined but not used
Remove these functions as they are unused.
A note about get_stop_quota_stats(). For stopped containers,
soft/hard quota limits are s...
vzlist: fix sorting for some fieldsApparently, column sorting order was wrong for some columns,
namely dcachesize.{m,b,l,f} and diskinodes.{s,h}. Fix it.
Interestingly, the bug was discovered because of the previous commit,
69417764, after which compliler complains:
CC vzlist.o
vzlist.c:400:1: warning: ‘dcachesize_m_sort_fn’ defined but not used
vzlist.c:400:1: warning: ‘dcachesize_l_sort_fn’ defined but not used
vzlist....
src/vzlist.c: declare most functions as staticThose functions (and a structure) are not used anywhere
outside of vzlist.c so declare them as static.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
debian-{add,del}_ip.sh: fix IPv6 wrt 2.6.32 kernelWhen vzctl attempts to add an IPv6 address to a Debian Lenny container on
2.6.32 no error is returned but the IP address is not added to the container.
vz-1:~# vzctl set 228 --ipadd 2001:0DB8::1
Adding IP address(es): 2001:db8::1
WARNING: Settings were not saved and will be resetted to original values on
next start (use --save flag)
vz-1:~# vzctl enter 228
entered into VE 228
228:/# ifconfig
l...
vzctl: use newer API for pci_add (v2)New kernels (since 2.6.32-042test005.1) contains virtualization for
generic linux devices. Now you can move any device and kernel will
create sysfs tree, send uevent and give permission for char/block
devices.
Old scheme was not good enough, so we removed it from kernel while
(hoping that) nobody's using it.
Additions by kir@openvz.org:
- remove nvidia module loading;
- remove structs and def...
etc/conf/ve-vswap*: fix DISKINODESApparently vzctl does not understand suffixes for DISKINODES,
so sed 's/200K/200000/'.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
etc/init.d/vz*: add kludge to modify default CT configOn a vswap-enabled kernel, it makes great sense to use vswap-enabled
CT configuration by default. For the sake of better solution, let's
check in vz initscript whether we run vswap-enabled kernel and if yes,
modify the value of CONFIGFILE= parameter in /etc/vz/vz.conf to be
'vswap-256m' instead of 'basic'. If CONFIGFILE is modified, do nothing.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
etc/conf: add vswap configsSo, in VSwap mode we only set RAM (physpages) and swap (swappages),
while all the other values are set to 'unlimited'.
Remember this is still experimental stuff, and it's only for
RHEL6-based (i.e 042test* and 042stab*) kernels.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
etc/conf/*conf-sample*: remove arch-specific entriesSince vzctl-3.0.24 we can specify 'unlimited' instead of numeric LONG_MAX
value in configuration files. That means that we can remove arch-specific
config files and just use common configuration samples for all arches.
If values were different in same config for different arches, I used
the maximal values.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
vps-functions: make sure PATH contains dirs we need'arpsend' is installed into our @SBINDIR@ (which can be /usr/sbin
or /usr/local/sbin or something else).
'ip' usually lives in /sbin or in some cases /bin. Previously
(in vzctl <= 3.0.24) we called in /sbin/ip, but commit 8894720
changes that.
So, make sure all these dirs are in PATH, so we don't fail miserably,
for example like this:
$ sudo /usr/sbin/vzifup-post eth1
/usr/lib64/vzctl/scr...