OpenVZ-legacy
  1. OpenVZ-legacy

vzctl.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
18e7b030710Released vzctl-3.0.29.3 CHANGES (since 3.0.29.2) Regressions: * vzctl set --hostname: fix adding netmask to /etc/hosts (#2014) * vzctl set --ipadd: if no netmask is specified, set it to /32 (#2017) Bug fixes: * Fix stdin/stdout after vzctl enter (#1956) * etc/init.d/vz-redhat: fix IPTABLES_MODULES usage (#2018) THANKS OpenVZ project would like to thank the following people who contributed patches and/or provide...
Dmitry KopytovKir KolyshkinDmitry Kopytov
ebc57a8d15fetc/init.d/vz-redhat: fix IPTABLES_MODULESThe description of variables in vz.conf says: * IPTABLES - IPv4 iptables kernel modules to be enabled in CTs by default. * IPTABLES_MODULES - IPv4 iptables kernel modules to be loaded by init.d/vz script. But I found init.d/vz script loads modules enumerated in IPTABLES variable instead of IPTABLES_MODULES. Here is a patch. [kir@openvz.org: this is a bug in commit d284c8a79] http://bugzill...
Kir KolyshkinKir Kolyshkin
7c664bd4de5Fix stdin/stdout after vzctl entervzctl enter sets O_NONBLOCK for stdin and stdout and forgets to restore original flags. This leads to following: HW# vzctl enter 104 --exec exit; read a entered into Container 104 CT104# exit logout exited from Container 104 bash: read: read error: 0: Resource temporarily unavailable Fix this by saving and then restoring stdin/stdout fd flags. http://bugzilla.openvz.org/1956 http://bug...
Kir KolyshkinKir Kolyshkin
5909e56ae2fvzctl set --ipadd: if no netmask is specified, set it to /32Before introducing netmasks support, vzctl always set netmask for IPv4 address to /32. Now it become configurable, but default was somehow set to /24. Fix it. http://bugzilla.openvz.org/2017 Reported-by: William Taylor <williamt@sonic.net> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c1d38acca48vzctl set --hostname: fix adding netmask to /etc/hostsAfter introducing netmask support, we forgot to strip off the netmask from a few places. This is another one of such places. I sincerely hope it's the last one. http://bugzilla.openvz.org/2014 Reported-by: William Taylor <williamt@sonic.net> Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 51086560f755aa5836fe99c35bc94d5ebff9d9df)
Kir KolyshkinKir Kolyshkin
a3645e28367Released vzctl-3.0.29.2 CHANGES (since 3.0.29.1) Regressions: * Fix broken venet networking (#2001) Bug fixes: * vzctl set --ipadd/--ipdel: a few fixes for IPv6 address case * vzsplit: fix kmemsize for vswap mode (#1994) * vzsplit: set swappages.barrier to 0 in vswap mode * vzsplit: set dcachesize to half of kmemsize (#1949) * vzlist: fix segfault when sorting by loadavg (#1978) * vzctl set --quotaugidlimit: try h...
Kir KolyshkinKir Kolyshkin
c94395171d5etc/dists/scripts/set_ugid_quota.sh: try to fix /etc/mtab harderIn case vzctl-3.0.28 or 3.0.28.1 (i.e. the one with commit e324b0ade8 but without commit bfe59a28b) was used on a container with quotaugidlimit, the CT might end up with an incorrect /etc/mtab file having simfs in fs field. The fix introduced later is correct, but it's not checking for the broken case like the one above. This case is fixed by this patch, which just blindly symlinks /etc/mtab -...
Kir KolyshkinKir Kolyshkin
dbd09c85a13vzctl set --ipadd: fix setting IP address with a netmaskWhen netmasks were added to vzctl (as per bug #1088) this place was forgotten. Unfortunately due to 'return 0' statement in case of error from get_netaddr() this error went unnoticed. Fix the case (by removing /mask from IP address string). Fixes http://bugzilla.openvz.org/2001 http://bugzilla.openvz.org/1088 Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit e8122a19c7...
Kir KolyshkinKir Kolyshkin
c99b417d3a0etc/dists/scripts/debian-add_ip.sh: a fix for IPv6 caseIn case of IPv6 address $_NETMASK can be empty, so we need to quote arguments, otherwise their positions will be shifted and we will end up having value of $IFNUM as $_MASK and empty $IFNUM. Bad bad bad. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 874cd35210b002b9a31fd633cb520d9007bcde95)
Kir KolyshkinKir Kolyshkin
b3f6433dfb3etc/dists/scripts/functions: fix a bad typoIt is supposed to be _IPV6ADDR, neither _IPV6_ADDR nor IPV6_ADDR. Shame shame shame shame. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit c812be79263e825404784d298b0ed72b5a5d95b1) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d01a48191a0vzsplit: set DCACHESIZE to half of KMEMSIZEAccording to http://bugzilla.openvz.org/1949 and http://wiki.openvz.org/VSwap Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit cbe70b02767acb3cc0ef20b9b7e6398cf7114de2)
Kir KolyshkinKir Kolyshkin
f95863402a9vzsplit: refactor kmemsize calculation in vswap modeShould have no visible effect. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 2bd8b73e660caf4c850ff8fa52748f8f96f11878)
Kir KolyshkinKir Kolyshkin
49e3bea1c79vzsplit: set swappages.barrier to 0 in vswap modeCurrently, kernel only uses swappages.limit, while swappages.barrier is not used and should be set to 0 (just in case). Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit c063dd6d3ccbc668c12db30790347ba323216439)
Kir KolyshkinKir Kolyshkin
dae7876cde8vzsplit: fix kmemsize in vswap modeAll other params are in pages, while kmemsize is in bytes. Oops. http://bugzilla.openvz.org/1994 Reported-by: Eric <openvz@hostultra.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 876c132c51c29bc17f5a63f1030c15f869834382)
Kir KolyshkinKir Kolyshkin
605591c400dvzlist: fix segfault when sorting by loadavgApparently the sorting (1) didn't work and (2) segfaulted in case some CTs didn't have load average values (which is pretty easy to have if you list stopped CTs). BTW this is a zero day bug (it comes from the initial vzctl commit to git), so it took about 6 years to discover it. My congratulations to Alexander! Reported-by: Shvayakov Alexander <a.shvayakov@gmail.com> Signed-off-by: Kir Kolysh...
Kir KolyshkinKir Kolyshkin
a6edc774241Released vzctl-3.0.29.1 CHANGES (since 3.0.29) Regressions: * Fix setting nameserver inside a CT (#1991) Bug fixes (that are not regressions): * Fix networking for Ubuntu-6.06 (#1802) * etc/init.d/vzeventd-gentoo: fix stopping vzeventd (#1980) * etc/init.d/vz-redhat: fix modules loading wrt dash (#1936) * etc/conf/ve-vswap-*sample: set dcachesize to half of kmemsize (#1949) * vzlist: show swappages (#1984) THANK...
Kir KolyshkinKir Kolyshkin
e645de6063fvzlist: show swappagesvzlist was using /proc/user_beancounters interface to read BC values. swappages is not there, so we need to switch to new (/proc/bc/resources) file, with an old one as a failover. http://bugzilla.openvz.org/1984 Reported-by: Slava Dubrovskiy <dubrsl@altlinux.org> Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 8b490bfeac05b03510d899667356331265af26c4)
Kir KolyshkinKir Kolyshkin
178b2c621ebetc/conf/ve-vswap-*sample: set dcachesize to half of kmemsizeOtherwise all the kernel memory could be eaten up by dcache, as shown in bug #1949. http://bugzilla.openvz.org/1949 Reported-by: Thomas Menari <tom@coreware.co.uk> Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit a3a907b0576548b5da27f43c73641ea7f7673827)
Kir KolyshkinKir Kolyshkin
6c69cef5c19etc/init.d/vz-redhat: fix modules loading wrt dashApparently different shells have different quoting rules. Quote $1 in load_modules() to be on the safe side. http://bugzilla.openvz.org/1936 http://bugs.debian.org/635730 Reported-by: Jean-Baptiste Rouault <jean-baptiste.rouault@diateam.net> Reported-by: Ola Lundqvist <ola@inguza.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 70ec772c5d407d867d45c73be56ea5454bcd...
PeterKir KolyshkinPeter
92a0cff18feetc/init.d/vzeventd-gentoo.in: fix service stopvzeventd does not create pid file. Drop its mentioning from init script to fix /etc/init.d/vzeventd stop. http://bugzilla.openvz.org/1980 https://bugs.gentoo.org/show_bug.cgi?id=382213 (cherry picked from commit 310770db7ee0f69478f9cc6b8ef4901276df3aa5)
Kir KolyshkinKir Kolyshkin
e65e9c4d0feetc/dists/scripts/set_dns.sh: fixCommit 7ff74dc4c is not that bad except for the fact that grep, unlike sed, exits with code 1 if the pattern is not found. This makes the script error out, which is very unfortunate. Go back to using sed. Note this is not a complete patch revert -- we still achieve what we wanted in commit 7ff74dc4c. Fixes http://bugzilla.openvz.org/1991 Reported-by: Scott Dowdle <dowdle@montanalinux.org> Si...
Kir KolyshkinKir Kolyshkin
63ff9412611Fix networking for Ubuntu-6.06This is an addition to commit e08d12dce. http://bugzilla.openvz.org/1802 Reported-by: Harald Kapper <hk@kapper.net> Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 9142950653ef476f2e56dd75ddd17d82783fa180)
Kir KolyshkinKir Kolyshkin
07805261620Released vzctl-3.0.29CHANGES (since 3.0.28.3) New features * vzctl set --ipadd: support for net masks (#1088) * vzsplit: support for VSwap enabled config generation Fixes * vzctl set --ipadd: fix default route disappearing in Debian-based containers after adding netmask (#1971) * configs: fix VSwap configurations * vzctl set/start: fix parsing T suffix on 32-bit boxes * vzctl set --d...
Kir KolyshkinKir Kolyshkin
6fd6b71bf1evzlist: fix .index for uptime and ioprioSet .index for "uptime" and "iolimit" fields to 0. It's unused by the corresponding formatters for the current vzlist output, but it will be used by a later patches. Reported-by: Roman Kagan <rkagan@parallels.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3c86631caccFix default route disappearing in Debian-based containersLet's take a Debian 6 CT with a network setup similar to this: cat /etc/network/interfaces # Auto generated lo interface auto lo iface lo inet loopback # Auto generated venet0 interface auto venet0 iface venet0 inet manual up ifconfig venet0 up up ifconfig venet0 0 up route add default dev venet0 down route del default dev venet0 down ifconfig venet0 down iface venet0 inet6...
Kir KolyshkinKir Kolyshkin
42b34bf8839bin/vzubc: fix -i/-r modes for 0th beancounterProblem: # ./vzubc -i -c -r -q 0 Error: can not use relative/incremental modes: BCID is unknown Cause: commit 50c173f4871e Solution: fix check for bcid to be less than zero, initialize bcid to -1 at BEGIN. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1bc4e8a2064bin/vzubc: fix for Debian/mawkDebian systems use mawk not gawk by default. Apparently, mawk lacks strtonum() function. We could just truncate the last character (which is ':'), but let's be lazy and use int() function which appears to be portable. Reported-by: Mario Kleinsasser <mario.kleinsasser@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ba6d94480a4scripts/vps-*: support for IPs with netmasksNow when vzctl supports venet IPs with netmasks (commit f018af5fa and others), we need to strip those masks from IP_ADDR list before dealing with it. http://bugzilla.openvz.org/1088 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
00f3681e63cscripts/vps-net_add.in: fix VE_STATE descriptionWhen running this script, VE_STATE can either be 'starting' or 'running'. State 'stopping' only makes sense for vps-net_del script. Fix a minor whitespace issue while at it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b7c58268392vzctl set --ipadd: fix for adding existing IP with different netmaskIf we are adding an IP, and the same IP is already in config (possibly with different netmask), add the IP from config to 'del' list (as if a user specified --ipdel). It will cause the from-config IP to be deleted and the from-command-line IP to be added. This makes most sense if netmask has changed, but even if it is the same, that kinda means "re-add this IP". This patch relies on previous c...
Kir KolyshkinKir Kolyshkin
e25558b2035vzctl set: fix exit code in case of invalid veth paramsReturn code from check_veth_param() is used as vzctl exit code: main() run_action() set() check_veth_param() So do return VZ_INVALID_PARAMETER_SYNTAX instead of -1. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c81b8fd6278src/lib/env.c: fix logging features maskWhen trying to compile vzctl with clang 2.8, got this: CC env.lo env.c:344:38: warning: length modifier 'L' results in undefined behavior or no effect with 'x' conversion specifier [-Wformat] logger(3, 0, "Set features mask %016Lx/%016Lx", ~~~~^~ env.c:344:45: warning: length modifier 'L' results in undefined behavior or no ef...
Kir KolyshkinKir Kolyshkin
3249c0d4201__merge_str_list(): 'add' list have a precedence over 'del'Consider the following command: vzctl set --ipdel 1.2.3.4 --ipadd 1.2.3.4 Before this patch, this does nothing. Now, we are adding values from the 'add' list even if they are in the 'del' list, thus forcing the command to remove the IP and add it again. This totally makes sense, provided we remove IPs first and then add those (need to check it). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
372080ff61betc/init.d/vz*: mount cgroupsNewer RHEL6-based kernels provides some information in /proc/vz/beancounter /proc/vz/container /proc/vz/fairsched but it needs to be mounted. Make sure init script takes care about this. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9a8350a4b91setver.sh: do not hardcore configure.ac and vzctl.specSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Andrey VaginKir KolyshkinAndrey Vagin
f319aef1d91Add SETFCAP to default capabilities in CTIn Fedora 15 some applications use file capabilities instead of suid bit, so file capabilities should be supported in CT. I checked this patch works with rhel5 kernel, because nobody worries about absent capability with number 31. http://bugzilla.openvz.org/1911 Signed-off-by: Andrey Vagin <avagin@openvz.org>
Kir KolyshkinKir Kolyshkin
382f306cd08etc/dists/scripts/{set_*,postcreate}.sh: de-bash-ifyThere is nothing bash-specific in these scripts, so make them executed by /bin/sh. Well, the true story is these scripts are read by vzctl and executed by running /bin/bash and then /bin/sh inside a container, when writing the 'functions' file and then the script contents to shell's stdin. So, these '#!/bin/whatever' does not really matter, and if bash is available it will be used since it is ...
Tim SmallKir KolyshkinTim Small
77c13606b08etc/dists/scripts/postcreate.sh: randomize /etc/cron.d entries, tooApparently modern cron daemons are not limited by /etc/crontab, there can also be some stuff at /etc/cron.d which we should also randomize. [kir@openvz.org: fix 'return 0' on no file found] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636463 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a86beacde8cetc/dists/scripts/deb*: de-bash-ifyMost of this is written in pure shell, so let's make it runnable by dash and busybox sh. Slightly checked on Debian 6 with dash using set --ipadd/--ipdel commands. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f83b28435f5etc/dists/scripts/functions: remove bashismsInterestingly, all this stuff is pure shell, except for 'function' keyword before function declarations. So let it be pure /bin/sh. Slightly tested with dash and busybox sh. While at it, also remove an unneeded semicolon. Reported-by: Sam Trenholme <strenholme.usenet@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
07d74e734feetc/dists/scripts/debian-del_ip.sh: fix a typoCommit 57842cb82 introduced a non-closed quote. Fix it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ee190993f53vzifup-post: do not fail if there's no /proc/vz/veipIn some situations (some of OpenVZ modules are loaded, some are not) we can have this: # vzifup-post eth0 awk: cmd. line:1: fatal: cannot open file `/proc/vz/veip' for reading (No such file or directory) Fix it by changing a check for /proc/vz/veinfo to /proc/vz/veip. Naturally, we don't care about veinfo, and we should not do anything if veip is not here. http://bugzilla.openvz.org/1918...
Kir KolyshkinKir Kolyshkin
ffa43535c79src/lib/config.c: move devperm2str() to after parse_dev_perm()Pure cosmetic change: two functions have similar meaning and so should be close to each other in the source file. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a91482976b3man/vzctl.8: use simfs in mount script exampleApparently bind mounts are not safe wrt checkpointing, i.e. if a filesystem being bind-mounted is not recognized by kernel checkpointing code (say, xfs is not in the list), then checkpointing will fail. To avoid this problem, use simfs instead of bind mount. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
4a0dd880a2fetc/dists/scripts/functions: fix a typoThe typo was introduced by commit 30d0cf8d. http://bugzilla.openvz.org/1088 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
554fd1673fevzctl set --devices|--devnodes: do not allow to enable loop devices in CTError out when trying to assign /dev/loop* into a CT. OpenVZ kernels do not support loop devices inside a CT. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f231b2b4fcfvzctl set --devices: option argument parsing fixesHere is one important fix, plus a number of improvements for parse_devices_arg(). (1) FIX parsing "permissions" (i.e. the last) parameter. Before this patch, documented value 'none' was not really recognized properly because string size was 3 (i.e. for up to 2 characters and a '\0' byte). Now, use size of 6 (up to 5 characters and a '\0' byte) to allow for values like 'none...
Kir KolyshkinKir Kolyshkin
287cc9d96b2parse_devices_str(): fix returning error codes(1) Fix returning an error if parse_dev_perm() failed (2) Change 1 to -1 (pure cosmetic) (3) No need for 'int ret', remove it Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3502d2b92d6setver.sh: fix spec releaseApparently, according to RPM, version 3.0.28.3-1 > 3.0.28.3-git*. It makes it impossible to upgrade from stable to nightly. Fix it by having a number of commits since the last tag as a first part of the release. In other words WAS: 3.0.28.3-git.57.30d0cf8 NOW: 3.0.28.3-57.git.30d0cf8 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
30d0cf8d761vzctl set --ipadd: treat IPs with different masks as the same oneIntroduce merge_ip_list() which is the same as merge_str_list(), only using find_ip() instead of find_str() for checking IP addresses. Since find_ip tries not to look at netmask (commit 0f8c65271), we will not have same IPs with different masks in the resulting list. Also, due to commit e3d0346df new values have precedence over the old ones, so --ipadd can be used to change the mask of the alr...