OpenVZ-legacy
  1. OpenVZ-legacy

vzctl

Public

Commits

AuthorCommitMessageCommit DateIssues
Kir KolyshkinKir Kolyshkin
3f386e2322dvzubc: allow for more than 999%Sometimes vzubc shows more than 999% (say, for oomguar held to barrier percentage) and it breaks the vertical alignment: # ./vzubc ---------------------------------------------------------------- CT 902 | HELD Bar% Lim%| MAXH Bar% Lim%| BAR | LIM | FAIL -------------+---------------+---------------+-----+-----+------ kmemsize|6.38M 33% 31%|19.3M 100% 94%|19.3M|20.6M| 645K loc...
Kir KolyshkinKir Kolyshkin
cff50b9dba0pathsubst.am: hide error from chmodThis is an addition to commit 302faf2. As noted there, chmod can fail, and its not an issue if it does. So, let's hide the error, such as this one from busybox's chmod: > chmod: unrecognized option: reference=vps-functions.in Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6c2010a0044Fix incorrect includesWhen compiling on Apline Linux 3.3.1, it complains: > In file included from enter.c:30:0: > /usr/include/wait.h:1:2: warning: #warning redirecting incorrect #include <wait.h> to <sys/wait.h> [-Wcpp] > #warning redirecting incorrect #include <wait.h> to <sys/wait.h> Indeed, it should be <sys/wait.h>. Same for <sys/poll.h> in vznnc.c -- it should be <poll.h>. Signed-off-by: Kir Kolyshkin <kir...
Kir KolyshkinKir Kolyshkin
8ff9f063608Fix compile on Alpine LinuxWhen compiling vzctl on Alpine Linux 3.3.1, there is a number of errors like these: hooks_vz.c:513:11: error: 'PATH_MAX' undeclared (first use in this function) hooks_vz.c:600:11: error: 'PIPE_BUF' undeclared (first use in this function) Fix by adding #include <limits.h> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
095c8d40ddaFix compile with musl (lack of strndupa)If strndupa is not defined, use an in-house implementation using alloca() (code taken from https://goo.gl/roIJt6). Patch is based on work by Dennis Przytarski. https://bugs.openvz.org/browse/OVZ-6650 Signed-off-by: Kir Kolyshkin <kir@openvz.org>OVZ-6650
Dennis PrzytarskiDennis Przytarski
301168dee34Fix compilation with muslI'm packing the tool for Alpine Linux 3.3. Alpine Linux uses musl-libc as standard C library. These are the fixes I managed to resolve.
Kir KolyshkinKir Kolyshkin
a4d3972dca8MMerge pull request #3 in OVZL/vzctl from ~FUSL/vzctl:master to master* commit '7adf0e57a0f240ce8bc64577dc40edcccbdeb4df': Fixed typo "remove" -> "remote"
FuslFusl
7adf0e57a0fFixed typo "remove" -> "remote"
Kir KolyshkinKir Kolyshkin
02cdc246454vzctl destroy: handle the semi-mounted ploopFor some reason, sometimes ploop is left semi-mounted (i.e. ploop device is present, but not mounted), and in such cases vzctl fails to destroy CT private: > # vzctl destroy 4956949 > Destroying container private area: /vz/private/4956949 > Warning: failed to remove /vz/root/4956949: Device or resource busy > Container private area was destroyed Alternatively, such a semi-mounted container d...OVZ-6553
Kir KolyshkinKir Kolyshkin
201b4e1e780ve_is_mounted(): describe the ploop semi-mounted caseI know it looks weird, but this is it -- originally I wanted to modify vps_is_mounted() is it would return "mounted" in case ploop device is mounted. But it would be a wrong thing to do since if CT status is "mounted", CT files are expected to be available from VE_PRIVATE, and it's not the case. So, the code is all here but it's commented out. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c2d3e1b0590vps_is_mounted(): pass the whole fs_paramWe gonna need the layout field in the next patch. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
bdec3b4bf3evzlist: get_ves_layout(): merge into get_mounted_status()This will be needed by the next patch. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
cb4a7e3b0d3vzmigrate: rm bashismAs reported by shellcheck, there's no 'let' in POSIX shell. Interestingly, dash supports it so I guess we're good, but let's fix it in the interest of purity. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ce632305063vzubc: rm unused varSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
91beb57f47bvz_restore: rm unused codeThis is a left-over after commit ae3ce45. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Sergey BronnikovSergey Bronnikov
cf1c5b50b18Released vzctl 4.9.4Changes: see https://openvz.org/Download/vzctl/4.9.4/changes
Igor SukhihIgor Sukhih
74985e4eef0MMerge pull request #1 in OVZL/vzctl from ~IBAZHITOV/ovz-vzctl:sec to master* commit '22d967c336de3db0d30dae2bb7b2a9a69a0686de': Store VE layout to VE config on start Store VE layout in VE config during create and convert Move layout and mode fields from vps_opt to fs_param config: constify input path src/.gitignore: add vzfsync, vznnc bin/.gitignore: add vzoversell
Igor BazhitovIgor Bazhitov
22d967c336dStore VE layout to VE config on startThis will help those, who didn't set the VE_LAYOUT into per-VE config manually. On the next CT start the autodetected VE layout would be saved in the VE config. Signed-off-by: Igor Bazhitov <ibazhitov@virtuozzo.com>
Igor BazhitovIgor Bazhitov
9e98ea630acStore VE layout in VE config during create and convertVE layout (ploop or simfs) is automatically detected based on presence of "root.hdd/DiskDescriptor.xml" file inside the VE private directory. Imagine that inside a simfs CT this file is created by some malicious user, which has root privileges there. When vzctl starts a CT, it would mistakenly autodetect the CT as being the ploop one! This design flaw leads to a certain kind of attack vectors, ...
Igor BazhitovIgor Bazhitov
3116b1fc255Move layout and mode fields from vps_opt to fs_paramThis is a preparation for saving VE layout in a per-VE config file. Moving the layout and mode fields to struct fs_param will save us plenty of various functions parameters changes. Signed-off-by: Igor Bazhitov <ibazhitov@virtuozzo.com>
Igor BazhitovIgor Bazhitov
3ad329bb6c0config: constify input pathSigned-off-by: Igor Bazhitov <ibazhitov@virtuozzo.com>
Igor BazhitovIgor Bazhitov
2786e96f2bfsrc/.gitignore: add vzfsync, vznncSigned-off-by: Igor Bazhitov <ibazhitov@virtuozzo.com>
Igor BazhitovIgor Bazhitov
f518005b43cbin/.gitignore: add vzoversellSigned-off-by: Igor Bazhitov <ibazhitov@virtuozzo.com>
Kir KolyshkinKir Kolyshkin
0d841aef199Released vzctl 4.9.3Changes: see https://openvz.org/Download/vzctl/4.9.3/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kirill KolyshkinKirill Kolyshkin
c18483d1b89MMerge pull request #2 from zzmp/feat/vps-net_add-force-routevps-net_add: add FORCE_ROUTE to change existing route to container
Zach PomerantzZach Pomerantz
91e700b9a26vps-net_add: add FORCE_ROUTE to change existing route to container
Kir KolyshkinKir Kolyshkin
485cb193459vzctl umount: fix exit code if CT is runningFixes the following issue: # vzctl umount 10101 Container is running -- stop it first # echo $? 0 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
24f939e8159vzoversell: handle unlimited RAM CTsSome containers might be configured as unlimited (i.e. infinite physpages and privvmpages limit). Also, a container might appear as unlimited while it is being restored from dump (as beancounter limits are initially set to unlimited and only set to proper values at the end of the restoration process). In case such unlimited containers are present, overcommitment figures shown doesn't make sen...
Konstantin VolckovKonstantin Volckov
137c14b2756set_console.sh: ubuntu 15.04 systemd console supportReference: PCLIN-32529PCLIN-32529
Kir KolyshkinKir Kolyshkin
cb7cd395f6bReleased vzctl 4.9.2Changes: see https://openvz.org/Download/vzctl/4.9.2/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
869f8d8cb77store_devnodes: fix NULL derefAs pointed out by Linas Žilinskas in bug #3228, we should check name for being non-NULL here. https://bugzilla.openvz.org/3228 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b0409ff0bf0vps-create.sh: use stat -f instead of dfOn a node with a stale NFS mount (not related to /vz), vzctl create fails after a long timeout. It happens because vps-create calls df $VE_ROOT, but for some odd reason df wants to stat() all the mount points and it hangs for a while and then fails on that stale mount. The solution is to use stat -f rather than df. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
4d4c21e1dbevzctl.spec: require attr packageIt never occured to me that setfattr can not be available, but it happens: # vzctl create ... ... Performing postcreate actions /etc/vz/dists/scripts/postcreate.sh: line 119: setfattr: command not found ... So, let's require it from spec file. This is an addition to commit f537353. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b7d68dbd360Released vzctl 4.9.1Changes: see https://openvz.org/Download/vzctl/4.9.1/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
cf652d0df15vzctl.spec: drop the Conflicts: vzkernelThe change this patch is reverting was introduced to fix bug #3094. Unfortunately, it breaks the update for RHEL5-based OpenVZ kernels, which is the subject of bug #3219. The only solution I found is to list all the old RHEL6-based kernel explicitly. It would be good enough, but looks ugly. As the newest RHEL6-based kernel conflicting with this vzctl is at least 2 years old, let's just drop t...
Kir KolyshkinKir Kolyshkin
3774851d661create_hardlink_dir(): fix wrong owner/perms caseIn case CPT_HARDLINK_DIR exists, is a directory, but its ownership and/or permissions are wrong, the best course of action is not to remove it, but just fix what's wrong. This is what this patch does. In addition: * mark create_hardlink_dir() as static (as it should be) * report and return a potential error from stat() syscall, (as it should not happen and if it is, it's probably fatal) Th...
Kir KolyshkinKir Kolyshkin
4a4beac565cReleased vzctl 4.9Changes: see https://openvz.org/Download/vzctl/4.9/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d375c03ea52vzmigrate: check CPU caps for suspended CTThis commit adds a check for CPU capabilities when migrating a suspended container. Such a check is needed because if CPU caps differ, a container might not survive restore after migrating. To implement this check, a support from the kernel is required (CPT_TEST_CAPS ioctl for /dev/cpt). Such support was errorneously removed from the kernel 042stab101.5, but then restored in 042stab107.1, so a...
Kir KolyshkinKir Kolyshkin
8e02bf02b70vzmigrate: fix for vzfsync if VE_PRIVATE differsWhen referring to DDXML, we assumed VE_PRIVATE == VE_PRIVATE_REMOTE which is not always the case. Fix it. https://bugzilla.openvz.org/3170 Reported-by: toumin <983510@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1cd0931da24etc/vz.conf: improve NEIGHBOUR_DEVS descriptionThis is an addition to commit 2869ab3 https://bugzilla.openvz.org/1289 https://bugzilla.openvz.org/3192 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Per JohanssonPer Johansson
358aa2dec17ct_enter(): enter mnt namespace lastmnt needs to be set last since it changes the filesystem. Runnig vzctl start on upstream kernel fails for me on CentOS 6.5. I used to run vzkernel but reverted to stock to be able to run docker / lxc at the same time. With strace I noticed it's failing to find /proc/<pid>/ns/pid and I traced that to the loop in hooks_ct.c. After it does setns on the mnt file the pid one no longer can be opene...
Kir KolyshkinKir Kolyshkin
2869ab3acc2vz.conf: allow list of interfaces in NEIGHBOUR_DEVSHistorically, allowed values for NEIGHBOUR_DEVS were either "detect" or any other value, in the last case "all devices" are assumed. It's time to change it. From now on, NEIGHBOUR_DEVS can be one of: * all (or empty string, or unset) -- old behavior (all devices are used * detect -- same as before, devices to use for ARP are detected * list:* -- devices are explicitly listed (as in "list:et...
Kir KolyshkinKir Kolyshkin
c502784b4e8vzctl set --devices: made cumulative, fixThis is the same as commits 90e8dd6 and b8708e2 for vzctl set --devnodes. From now on: * the option is now cumulative, so any new devices set by "vzctl set --devices" command are added to the existing devices * vzctl set --devices t:major:minor:none --save" removes the device from the configuration. Note if last device is deleted from the list, we have to add DEVICES="" to the configurat...
Kir KolyshkinKir Kolyshkin
b93eefb62db[style] store_devnodes(): fix a commentThis is an addition to commit b8708e2. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1a348851c27store_dev(): introduce PRINT_DEV macroThis is a preparation to the next patch. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
fc1f1357039vzctl set --devices: fix SIGSEGVThis is caused by the commit c2a48a7e. Note add_dev_param() is called from parse_devices_str() in which name is not set, so we shouldn't blindly use strdup(). https://bugzilla.openvz.org/3189 Reported-by: Devon <devon.b@virtualcomplete.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1a89ea43a65init.d: exit code if vzctl or vz.conf not foundIn case vzctl binary of vz.conf global configuration file is not found, we should not exit with 0. Instead, use codes 5 "program is not installed" and 6 "program is not configured", as per LSB http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html https://bugzilla.openvz.org/show_bug.cgi?id=3195 Reported-by: nethubonline@gmail.com Signed-off-by: Kir Kolysh...
Kir KolyshkinKir Kolyshkin
6031c647f97init.d/vz-redhat: fix exit code according to LSBIn case an invalid command is specified, we should return exit code of 3 -- <<unimplemented feature (for example, "reload")>> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3353ac0b0c2vzeventd(8): document new behaviorAs per previous commit, vzeventd now processes all known events. Document it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
41ef81e0879vzevent: try to run a script for all known eventsPreviously, we only tried to execute vzevent-stop and vzevent-reboot scripts. This change makes vzevent process all known events as they come from the kernel. Unknown (not recognized) events are still logged as errors (maybe we need to change that). Signed-off-by: Kir Kolyshkin <kir@openvz.org>