OpenVZ-legacy
  1. OpenVZ-legacy

vzctl.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
f5773a426caReleased vzctl-3.0.25.2This is a next stable update to 3.0.25, fixing the following bugs: * vzeventd: do not leave zombies * vzeventd: fix logging of killed children * vps-functions: make sure PATH contains dirs we need * rpm: add /etc/sysconfig/vzeventd as %ghost %config Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
87eefb04654vps-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...
Kir KolyshkinKir Kolyshkin
4cd65f461f8vzctl.spec: add /etc/sysconfig/vzeventd as %ghostTeach RPM that if this file exists then it's ours. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit e816ee05792dbd8038c905f06cb557acae05e840)
Kir KolyshkinKir Kolyshkin
154c13fa5f6vzeventd: fix child handler to avoid zombiesSometimes a signal is not delivered (and child_handler() is not called) for every single child exited or terminated, which causes zombies to appear. Use waitpid() and loop until all the children are properly reaped. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit d7ac02f58412526632ec7751aee56c04580be988)
Kir KolyshkinKir Kolyshkin
df2118d65adsrc/vzevent.c: fix logging of child killedCheck for WIFSIGNALED was done under WIFEXITED which is just plain wrong, therefore we never got "Child killed" message. Fix it. While at it, change the message from 'was terminated' to just 'killed'. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 11ff8a43cb14b4b576a2810b74297cc7f419c4b0)
Kir KolyshkinKir Kolyshkin
c54f71c574dsrc/vzevent.d: simpler child handlerUse old-style singal handler function, we don't really need any of the fields provided by struct siginfo_t, and pid is returned by wait(). Pure simplification, should not have any visible effect. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit 8afe85a38f4e4ae3e9bea8d3cfee794a119e5c9d)
Kir KolyshkinKir Kolyshkin
c10f5c17bc3Released vzctl-3.0.25.1This is a stable update to 3.0.25, fixing the following regression: * vzctl set --devices: do not segfault (#1729) Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
aa454f2fa01vzctl set --devices: do not segfault (v2)This is an addition to commit ea64ee6b9. It fixes segfaults in four different places when either '--devices' command line option and/or 'DEVICES=' parameter in configuration file is used. http://bugzilla.openvz.org/1729 Reported-by: Vyacheslav Nikitin <alien.virus@gmail.com> Reported-by: Paparaciz <helpaz@gmail.com> Reported-by: frank <frank@si.ct.upc.edu> Signed-off-by: Kir Kolyshkin <kir@op...
Kir KolyshkinKir Kolyshkin
6e776e3494eRevert "vzctl set --devices --save: do not segfault"This reverts commit ba865963f38c747b0732db0ff8401ff5184db1b8. The proper fix will follow.
Kir KolyshkinKir Kolyshkin
ba865963f38vzctl set --devices --save: do not segfaultThis is an addition to commit ea64ee6b9. It fixes segfault in store_dev() when --devices option was used. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
a3f8f060135Released vzctl 3.0.25 CHANGES (since vzctl-3.0.24.2) * Removed cron scripts to handle cleanup and reboot (#1423) * Introduced vzeventd to handle cleanup and reboot (#1519) * vzctl start/runscript: add ability to set per-CT osrelease (/etc/vz/osrelease.conf) -- support for Fedora 14 etc. (#1709) * vzctl set --pci_{add,del}: add the ability to move PCI devices to CT * Removed FAKEGATEWAY routing for all distro...
Kir KolyshkinKir Kolyshkin
62596d16045etc/init.d/vzeventd-redhat: prevent second startIf $lockfile is present, do not start again. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6f929a78349vzeventd: be more quietPrint "Started" to log later (after daemonizing), therefore leaving stdout clean. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3bf621636abvzctl.spec: make sure to start vzdaemon after upgradeIf vz is running and vzeventd is not -- start it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
2ca87e0966dsrc/vzeventd.c: fix compile on CentOS 4Old and ancient CentOS4 glibc-kernheaders package provides /usr/include/linux/netlink.h which does not #include <linux/types.h> so we have to do it explicitly, otherwise: CC vzeventd.o In file included from vzeventd.c:25: /usr/include/linux/netlink.h:22: error: syntax error before "__u32" /usr/include/linux/netlink.h:28: error: syntax error before "__u32" /usr/include/linux/netlink.h:30:...
Andrey VaginKir KolyshkinAndrey Vagin
e8a76d31a58Add the ability to move PCI devices in CTSigned-off-by: Andrey Vagin <avagin@openvz.org>
Andrey VaginKir KolyshkinAndrey Vagin
115195e77b5Add vps-pci scriptThis script will be executed after moving pci device in container. [kir@openvz.org: shell script style improvements, added missing C includes] Signed-off-by: Andrey Vagin <avagin@openvz.org>
Andrey VaginKir KolyshkinAndrey Vagin
10c652a7eb1update include/linux/vzcalluser.h (v2)Signed-off-by: Andrey Vagin <avagin@openvz.org>
Andrey VaginKir KolyshkinAndrey Vagin
ea64ee6b9a4vzctl: allocate a device name dynamicallyBefore this patch a device name has been limited by 32 symbols Now we want add input device for exmple: /dev/input/by-path/pci-0000:00:12.0-usb-0:3:1.1-event Signed-off-by: Andrey Vagin <avagin@openvz.org>
Andrey VaginKir KolyshkinAndrey Vagin
913ebc6bc9fvzctl: code refactoring in free_devSigned-off-by: Andrey Vagin <avagin@openvz.org>
Andrey VaginKir KolyshkinAndrey Vagin
019e6fc2c29vzctl: device name may contains colons, so take last for parse permsSigned-off-by: Andrey Vagin <avagin@openvz.org>
Solar DesignerKir KolyshkinSolar Designer
9ae1302bbe5scripts/vps-create: fix VE_PRVT permissionsScript's $VE_PRVT is something like /vz/private/100.tmp, which will be renamed into the new container's tree root directory (/vz/private/100 in this example). Some templates do not include an entry for "." or "/". When these are used (with "vzctl create") on a host system with umask 077 (Owl's default), this resulted in the new system's root directory having mode 700, and in turn in all sorts ...
Kir KolyshkinKir Kolyshkin
c1e7b64e934scripts/vps-create: use -Sp options for tar-S: handle sparse files more effectively -p: ignore umask, use exact permissions from the archive Reported-by: Solar Designer <solar@openwall.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f62b006905bvzctl set --features bridge: enable CAP_NET_ADMINCapability CAP_NET_ADMIN is required for VE_FEATURE_BRIDGE to work, so let's raise it automagically. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Solar DesignerKir KolyshkinSolar Designer
8b92f8efbcfetc/dists/scripts/*set_ugid_quota.sh: fix mtab permsIn *set_ugid_quota.sh scripts, set the permissions on /etc/mtab to 644 regardless of the current umask.
Kir KolyshkinKir Kolyshkin
5a1014ac69eetc/vz.conf: fix English in a comments/do/does/ From the OWL linux vzctl patches. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
99970893815Fix enabling sysfs feature by defaultThe problem caused by this bug is if some other features are explicitly set, SYSFS is not enabled by default. From Solar Designer: """ This commit looks buggy to me: http://git.openvz.org/?p=vzctl;a=commit;h=vzctl-3.0.23-262-g2660464 - if (!(res->env.features_known & VE_FEATURE_SYSFS) && - sysfs_required(res)) { + /* sysfs enabled by default, unless explici...
Kir KolyshkinKir Kolyshkin
5ae864833e3etc/ve-basic.conf-sample: increase LOCKEDPAGESRecent distros (Fedora 14 and Ubuntu 10.10) want more. Make them happy. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ee27b83b15cvzlist: introduce uptimeSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
84d1e21561bvzlist: rename Cla to CcpustatShould not have any visible effect. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
2f8052666a6vzlist.h: load average should be floatNo need for double precision here. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
927213603d4src/lib/util.c: remove an unused functionNobody uses it, and the name is too generic. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f0a858dde08vzctl start/runscript: add ability to set per-CT osreleaseSome distros (like recent Fedora versions) expect a kernel version to be x.y.z or newer, and won't work with older kernels. Our kernels are usually sufficiently patched to work with new userspace, but this check for kernel version requires some trickery. Introduce /etc/vz/osrelease.conf to have these requirements configurable. Use new /dev/vzctl ioctl to set per-CT osrelease field, based on di...
Kir KolyshkinKir Kolyshkin
849cd39350ascripts/.gitignore: updateRecent commits (like 4cc6257616 and 5b3579775) removed some scripts, added some different ones. Update gitignore accordingly. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ecc86b67f66src/arpsend.c: cleanups1. Make it fit 80 columns 2. Fix English in comments and variable names. 3. Remove one trivial once-used define.
Kir KolyshkinKir Kolyshkin
de504a6d62csrc/arpsend.c: fix a compiler warningFix a long-standing compiler warning: arpsend.c: In function ‘create_arp_packet’: arpsend.c:354:3: warning: missing initializer arpsend.c:354:3: warning: (near initialization for ‘(anonymous).sndr_hw_addr’) Should have no visible effect. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
fc699530bb5src/lib/quota.c: compilation fixFix after commit 788cb03b. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
01ea58ce2dbsrc/lib/exec.c: flush stderr/stdout fefore fork() in vzctl_exec*()Otherwise it might be flushed twice after fork(), producing extra garbage as a result. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3063fa71631src/lib/exec.c: add a comment explaining the reason for fork()Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
788cb03bea6quota_ctl(), vps_set_quota(): refactor/fixThere is no need to do hairy trickery with return values in quota_ctl() -- always return the exit code of vzquota. In vps_set_quota(), when we run quota_ctl(STAT2), we need to find out if UGID quota is running or not. If it's not running vzquota returns exit code of 9, which we check for. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b63910d235fvps_set_quota(): return proper error codeWe should return VZ_DQ_SET here in case of error like this, because this code is used as an exit code of vzctl and -1 just doesn't make sense here. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f7bb97c6eeasrc/lib/quota.c: don't check for dq_param == NULLThere is no need to check for dq_param == NULL here, it can never be NULL. Also, the return code of -1 is bad because these functions are expected to return codes suitable as vzctl exit codes. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9783f43546bman/vzctl.8: add/describe 'vzquota on failed' exit code (60)After commits d75908d0 and 84f9ab9329 vzctl may now exit with VZ_DQ_ON (60) exit code, which means 'vzquota on failed'. Document it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
84f9ab9329equota_on(): refactor and fixThis is more of a fix than proper refactoring. So what I tried to achieve is: 1. Return proper code (one of VZ_DQ_ON, VZ_DQ_INIT, VZ_DQ_SET) depending on what really failed. 2. Do not print errorneous "vzquota on failed" with wrong exit code for the case of failed quota_init() or quota_set(). Note that quota_init() and quota_set() print their own error messages and return correct...
Kir KolyshkinKir Kolyshkin
767a651bfd6vzctl set --devnodes: always try to recreate device in CTIf device file already exists inside a container, do not trust it, it might be bad (not a device file, invalid/old major/minor etc). Always re-create device file from scratch. Reference: PCLIN-28558 Signed-off-by: Kir Kolyshkin <kir@openvz.org>PCLIN-28558
Kir KolyshkinKir Kolyshkin
f52f28f1071vzctl quotaoff: fix wrong exit code if quota is not runningIf quota is not running, we should not return an error when trying to turn it off. There is such a code already, but it forgot to set ret to zero, therefore the native exit code from vzquota (6) was returned by vzctl which makes no sense (for vzctl 6 means "Not enough system resources"). Fix it by 'ret=0' in case quota is not running. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
237f03c9480vzctl --help: improve/reformat, add quota* commandsFirst, let's just use one single fprintf. Should not have any visible effect per se. Second, make sure we fit into 80 columns (moving --netif_del to another line). Third, change the order of commands (first create, then start, then anything else). Fourth, introduce a few empty lines for better readability. Finally, add quotaon/quotaoff/quotainit commands. Signed-off-by: Kir Kolyshkin <kir@...
Kir KolyshkinKir Kolyshkin
51ebab04b1abash_completion: add quotaon/quotaoff/quotainitSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ff26307b24dman/vzctl.8: describe quotaon/quotaoff/quotainit commandsSomehow they left undocumented until now. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d75908d0e73vzctl quotaon|quotaoff|quotainit: report and return error if disk quota is disabledIf disk quota is disabled (either globally or for this CT) do not just silently skip this step, but print an error message and return an appropriate error code. Signed-off-by: Kir Kolyshkin <kir@openvz.org>