OpenVZ-legacy
  1. OpenVZ-legacy

vzctl.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
a136c4e3d66Released vzctl 3.0.27CHANGES (since 3.0.26.3) New features: * vzubc: a script to show User Beancounters for mere mortals (#845) * init.d/vz*: use separate IPTABLES_MODULES variable (#1814) Fixes: * dists/scripts: fix /etc/hosts localhost aliases handling (#1877) * debian-add_ip.sh: fix a lintian warning about initscript call (#1640) * init.d/vz-gentoo: force loading network modules, load vzethdev * vzgetnetdev: f...
Ola LundqvistKir KolyshkinOla Lundqvist
b10871b7055debian-add_ip.sh: call initscript via invoke-rc.dFix this lintian warning: W: vzctl: script-calls-init-script-directly ./etc/vz/dists/scripts/debian-add_ip.sh:182 N: N: This script apparently runs an init script directly rather than using N: invoke-rc.d. While use of invoke-rc.d is only required for maintainer N: scripts, supporting the policy layer that it implements is a good idea N: in any script. N: N: Refer to Debian Poli...
Kir KolyshkinKir Kolyshkin
9ed576fdb80.gitignore: add cscope.out
Kir KolyshkinKir Kolyshkin
429988ddaacpostcreate.sh: use exit not returnIt was always 'return 1' for some reason. Actually the result is the same: script will fail with exit code of 1, it's just an ugly warning... Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d22b98dc3e5vzubc: fix controversion between CTID and file nameNow to specify a file name (which is very rarely needed, mostly for debug) one needs to use -f option. So the only use for 'non-option' arguments is CTID or CT name. Thus, it is now possible to use CTIDs of deleted containers (when a container is stopped/removed, but beancounters still remain). Fix usage() and the man page accordingly. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e4a67cc527fvzubc: fix processing -rd|-id optionThese options come with an argument, so we need to do 'shift' which was absent. Fix it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
619ded8d291etc/dists: add scientific.confIt's the same as RedHat, RHEL, and CentOS, so make it an alias to redhat.conf Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
bbb7f758ccdetc/dists: rm centos.conf, make it an alias of redhat.confThey were the same, so let's reuse redhat.conf to make things simple. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a6b69d35b8cvzubc: do not multiply failcnt for *pages resourcesvzubc shows *pages resources in bytes (by multiplying those to page size, i.e. 4096). Surely, while held, maxheld, barrier and limit should all be multiplied, failcnt should not! Fix it by not providing the name of the beancounter to hr(). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ca7b96bb7bdvzubc: fix columns formattingIt was a bit off. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0c2b4d2da00vzctl set --devices/--devnodes: save 'q' permission bit.http://bugzilla.openvz.org/1876 Reported-by: Maxim Shchelokov <maks3004@inbox.ru> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
dfc7a039d7aetc/dists/scripts/functions: fix localhost aliases handlingThere was a typo (introduced by commit 3e513e53) which prevented more than one alias from being handled. Fix it. http://bugzilla.openvz.org/1877 Reported-by: Dietmar Maurer <dietmar@maurer-it.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
03651906e58man/vzubc.8: add EXAMPLESSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d94b25ef836man/vzubc.8: explain more on using CT names.Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d877f9a0717vzubc: add incremental modeThis adds a column with difference (delta) for held value. Combined with -q it makes a very interesting display. The mode is very slow due to a big number of files to read/write. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
efd48016ed9vzubc: decrease bar%/lim% precisionUse only one decimal point (i.e. 0.1% not 0.12%) when showing [max]held / limit percentage ratio. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a83e71efb14vzubc: better handle -qh, -qm options1. Options -qh or -qm set threshold for quiet and color highlighting, and are sensless if neither quiet nor color are used. Print an error if -qh, -qm are used w/o --color or --quiet. 2. Do not auto-enable quiet mode if -qh, -qm are used (since they might be used for --color). 3. In usage(), describe that --color uses same thresholds as quiet. Signed-off-by: Kir Kolyshkin <kir@openv...
Kir KolyshkinKir Kolyshkin
869c286c47cman/*: fix dates in headers and year in Copyrights.Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
07b371a7f28vzubc: add a man pageSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ecb12941410vzubc: s/watermark/threshold/Use a better term for quiet ratios. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e69675a560evzubc: lower chances to lose dataOption -rc can be dangerous if used together with -rd (think of "vzubc -rd $HOME -rc")! Do not try to delete the files recursively and add the "ubc." prefix to the files we create to lower the chances of removing something we didn't create. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e69a8399696vzubc: support for -c, --color optionWe use the same thresholds as for --quiet to find out "important" lines. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0f6e3a2e557vzubc: fix bug of not handling /proc/bc/resources absenseIn case /proc/bc/resources is not found we fall back to /proc/user_beancounters. Due to a typo it was not working. Fix it. (This one is important since inside a container we don't have /proc/bc, so using /proc/user_beancounters is the only option. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1b8f84f38aevzubc: add long option equivalentsThese are --quiet (-q), --relative (-r), --watch (-w) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c813e587585vzubc: rename 'cumulative' mode to 'relative'Also options -c* to -r* Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
fed3793995bvzubc: calculate relative failcnt before assessing importancefunction important() was always called for absolute value of failcnt. In case cumulative mode is used it is just wrong. Move failcnt calculations before important() call. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
4233e549330vzubc: distinguish between two importance levelsfunction important() (which is currently only used for quiet mode) now returns 0 in "not important" case, 1 in "maybe important" case, and 2 in "important" case. This will be used to colorize the output. While at it, fix passing failcnt to the function. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
19d65f3cabfinit.d/vzeventd-gentoo: give up if kernel is non-OpenVZDo not try to do anything if the kernel is not an OpenVZ kernel. Do it silently, because a warning message will be printed by vz initscript. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e3c5140ae03init.d/*redhat: less noise then running under non-OpenVZ kernelBefore this commit, when a (RedHat/Debian/SUSE) system is starting under non-OpenVZ kernel, the following is shown: FATAL: Module vzevent not found. Checking vzevent kernel module ... [FAILED] Running kernel is not OpenVZ kernel. [FAILED] It's a bit too much. Make it just: Running kernel is not OpenVZ kernel Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0a58846ed5fAdd vzubc - a tool to show beancounters in a human-readable formatThis is still a work in progress, but overall I am starting to like it. FEATURES: * Held, maxheld, barrier, limit, and fail counter are shown for every beancounter. * Zero and unlimited values are shown as " - " * Values that are in pages are converted to bytes. * Long values are converted to kilo-, mega-, gigabytes etc. * For held and maxheld it shows how close the value to the barrier and th...
Kir KolyshkinKir Kolyshkin
de8b7f63b36vzctl: do not warn about valid config parametersPrevious commit e0edb7ccba9 made it possible to make vzctl whine about unknown parameters in configuration files. Apparently, there are quite a few parameters that are pretty valid but not used by vzctl. List such parameters in config[] to avoid "false positives", reducing the noise. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e0edb7ccba9vzctl: do report unknown parameters in configWhen we are parsing configuration files, unknown parameters are ignored, and this behaviour is documented at least in vz.conf(5) and ctid.conf{5} man pages. It makes sense because it is possible to add some additional parameters to config which are to be used by tools other than vzctl. Nevertheless, sometimes it makes sense to report unknown parameters (for example, if there is a typo). This ...
Kir KolyshkinKir Kolyshkin
59817219985vzctl: fix unrecognized option reportingApparently glibc's getopt_long() uses argv[0] when reporting option parsing errors. Since we play with argv/argc in main(), argv[0] becomes CTID, which doesn't make sense. After we parsed CTID, we can reset argv[0] to be original argv[0], ie the name of the executable. Before this patch: # vzctl set 101 --some 101: unrecognized option `--some' After: # vzctl set 101 --some vzctl: unrecogn...
Kir KolyshkinKir Kolyshkin
72a2125c50dlib/net.c: fix dcachesize/kmemsize leak on --netdev_del1. There should be no fork()/setluid() performed on VE_NETDEV_DEL, otherwise a few sysctl entries will be pinned to CT's beancounters. This should fix dcachesize/kmemsize leak on --netdev_del. 2. There is no need to do setublimit(), and there is no need to do fork() after setluid(). This simplifies the code a lot. 3. Fix a logger() statement: errors come with log level of -1. Issue PSBM-7272...PSBM-7272
Kir KolyshkinKir Kolyshkin
c48069ee8b1vzctl start: set ipv6.conf.all.forwarding=0IPv6 forwarding should be enabled on the host system (since it acts as a router) but disabled in CT. By default, kernel (at least RHEL6-based, with net namespaces) derives IP configuration of CT from the host, so we need to explicitly disable forwarding in vzctl on CT start. This makes DHCP6 working inside CT with veth device. If a user wants to enable IPv6 forwarding, he can still use standa...PSBM-7458
Kir KolyshkinKir Kolyshkin
6cd932e8960vps_parse_config(): better warnings/errors while parsing config1. s/dup/duplicate/ 2. Always say parameter, value, file name and line number, so it's easy to track down what's wrong. Compare: Warning: dup for LOGGING=no in line 9 is ignored and Warning at /etc/vz/vz.conf:9: duplicate for LOGGING ("no"), ignored 3. Unify messages (was/is// etc) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3986c734604parse(): return errors in a few casesIn a few cases that were ignored before, we now return a proper error code (either ERR_INVAL or ERR_DUP). It should improve diagnostics printed by vzctl in case something is going wrong. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
755c4d0f588parse(): do not return -1We just can't return -1 from parse(), since callers are expecting us to return ERR_* codes (and, coincidentally, -1 is ERR_DUP which doesn't make sense in this case). Use ERR_OTHER for this situation. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
eda7487ed15Handle all error codes from parse():1. vps_parse_config(), parse_opt(): Handle ERR_OTHER. 2. parse_opt(): refactor -- use switch statement instead of an endless if/else if chain 3. parse_opt(): make it clear we ignore ERR_DUP. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
31a6b3a2629set(): return proper errorWe can't return ERR_NOMEM from set() function, as it can be used as an error code returned from vzctl, and ERR_* are only for parse(). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c2d467aff51src/lib/config.c: indentation fixSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
46050b25777Fix a return code from parse()When parsing VERBOSE= parameter in global config and malloc() failed, we should return ERR_NOMEM which is then handled by parse() caller. Bug is introduced by commit dbf8641e. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8d722d48e19vzctl --verbose: remove the logic of specifying a valueThere is rarely a need to specify log verbosity as a numeric value from the command line, and this was never documented. So, instead of documenting it, let's just remove this feature. If a user wants vzctl to be more verbose, (s)he can give --verbose flag multiple times (or set VERBOSE in vz.conf). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
af42bbd1ec7vzctl: do not allow too high CTIDCommit 8785cbd2 already introduced the check for too high CTID. Some kernels also use a few values close to INT_MAX for internal purposes, so such CTs can not be started. Add CTID_MAX and fix the check for CTID to use it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
282d6f8aebbman/vzctl.8: many fixes to --quiet/--verbose description1. vzctl runscript can also accept flags. 2. Explain that flags can be used before any command. 3. Explain that these are only affecting console output, not file logging. In --quiet description it was incorrectly stated that it affects log file as well. 4. Note that scripts run by vzctl are still able to produce some output. 5. Explain where a default for --verbose comes from. 6. --v...
Kir KolyshkinKir Kolyshkin
05e7faf0c28Fix: --quiet ignored for global config options parsingHere is the bug: # vzctl --quiet start 202 Warning: Unknown iptable module: ipt_iprange, skipped Warning: Unknown iptable module: sinexiud, skipped Apparently --quiet is ignored here. The reason is init_log() is called two times (second time after parsing global config, so the values of LOG_FILE, VERBOSE etc are known), and for the first time it is called without passing the quiet flag. F...
Kir KolyshkinKir Kolyshkin
a25a6aa448dman/vz.conf.5: better explain LOG_LEVEL and VERBOSE1. Make sure reader gets that LOG_LEVEL is only for log file, while VERBOSE is for console. 2. Add default value for LOG_LEVEL. 3. Describe what happens if LOG_LEVEL=-1. 4. Emphasize VERBOSE description. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
90b120673d8Fixed log level in a few placesErrors should go with log level of -1. Found a few places where errors are printed (and errno is used) but log level is not -1. Fix it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9f98998b381etc/osrelease.conf: debian-6.0 needs 2.6.32Unlike Fedora, there's no code in Debian glibc that shuts it up completely if the kernel is older than expected. But Debian apt complains about older kernel sometimes. Make it happy :( Reported-by: Hristo Benev <foxb@abv.bg> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c40722288c1etc/dists/scripts/set_ugid_quota.sh: add LSB tags to vzquota initscriptOn Debian systems, insserv complains loudly about this crippled script: insserv: warning: script 'S06vzquota' missing LSB tags and overrides insserv: warning: script is corrupt or invalid: /etc/init.d/../rc6.d/S00vzreboot insserv: warning: script 'vzquota' missing LSB tags and overrides insserv: There is a loop at service vzquota if started insserv: There is a loop between service vzquota and ...