OpenVZ-legacy
  1. OpenVZ-legacy

vzctl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
e076fd8b258Released vzctl 3.0.24.1This is a stable update to 3.0.24, fixing some regressions: * vzctl start --wait: fix for Fedora 13 * fix running default distscripts if OSTEMPLATE is not set * vzmigrate: migrate premount/postumount action scripts * vzctl set --hostname: back to FQDN for Red Hat and Slackware * vzmigrate: ignore error 24 from the first rsync run * bash_completion: vzlist's stderr goes to /dev/null Signed-off-...
Kir KolyshkinKir Kolyshkin
cea1f9509b0bash_completion: vzlist's stderr goes to /dev/nullvzlist can write some warnings to stderr. This is not what we want to see while working with bash_completion. Example of what could happen before applying this patch: vzctl create <tab>Invalid value for IOPRIO=88, skipped Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
540ac78700dvzmigrate: ignore error 24 from the first rsync runNow, when we really started to check the exit code from rsync, we got the following problem. Apparently, sometimes first rsync run fails with error 24, it happens when a file to be transferred is removed. Since the container is running at this time there is nothing wrong with it, so ignore error 24. Should fix bug #1580. http://bugzilla.openvz.org/1580 Reported-by: Roman Veretelnikov <roman@...
Kir KolyshkinKir Kolyshkin
2bcfc6dbdb9vzctl set --hostname: back to FQDN for Red Hat and SlackwareCommit 57bfaa5a61064 was a bit radical in that it removed the FQDN from all of the places. As many people pointed out, Red Hat's /etc/sysconfig/network is expected to have HOSTNAME= value to be FQDN, for example, see [1]. Fix that by reverting a hunk in the above commit. While at it, I have checked if the issue is valid for other distros: 1. Gentoo: /etc/conf.d/hostname should be hostname-on...RHEL-4
Kir KolyshkinKir Kolyshkin
e5377a816e1vzmigrate: migrate premount/postumount action scriptsCommit eeceb721472483f6e8d90cbfe72967c3336b5e77 added support for premount/postumount action scripts. vzmigrate should know about these scripts in order to migrate them. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit b8aa99670ac2905b3a4ed44edd75d259e7b258be)
Kir KolyshkinKir Kolyshkin
b8f60495c1aRevert "Check for memory granted by get_dist_name"This reverts commit 80ad89e384e04bd0835a13f246840f4f71113263. The commit have a few problems, unfortunately I overlooked it. 1. return NULL from get_dist_name() is perfectly valid, it means that both tmpl->dist nor tmpl->ostmpl are NULL. This NULL is later handled by read_dist_actions(). With this patch return NULL from get_dist_name() becomes an error, but there is no error! 2. ...
Kir KolyshkinKir Kolyshkin
ef4d336f93bvzctl start --wait: fixed order of checking for upstart config dirsWe need to check for /etc/init/ (new style upstart) before /etc/event.d/. This should fix --wait on Fedora 13. Signed-off-by: Kir Kolyshkin <kir@openvz.org> (cherry picked from commit ac4a19ff2c6de9a2ea56eeeeaca14ea738ed5b2d)
Kir KolyshkinKir Kolyshkin
76f166a0502Released vzctl 3.0.24CHANGES * Added new swappages UBC parameter * Added new vzctl set --features: ppp, ipgre, bridge, nfsd * Feature 'sysfs' is now on by default * Added new CT parameter: bootorder (#1300) * Added delete alias for destroy command * Added unlimited CT config (#1080) * Added support for vps.create global user script * Added support for premount and postumount global and per-CT user scripts * Added ...
Kir KolyshkinKir Kolyshkin
f82f69af247vzmigrate: saner output for non-existing CTIDCommit 484afba08 added support for CT names. It works, but one corner case is not working particularly well. When non-existing numeric CT ID is supplied, vzlist prints "Container(s) not found" error which is a bit misleading. (If non-numeric non-existing ID is supplied to vzlist the error is "CT ID 12434a is invalid" which is fine in the context of running vzmigrate.) To fix this problem, dd a...
Kir KolyshkinKir Kolyshkin
bc490300c17vzmigrate: saner output in case of absent configThere is a statement that checks the readability of both global and CT configs in one sitting. In case of problem it reports: Can't read global config or CT #$VEID config file This message is a bit strange, because it's not clear what file is missing. To fix, remove the check for per-CT config file and fix the error message accordingly. Check for per-CT config is done later, when vzctl st...
Kir KolyshkinKir Kolyshkin
f43fe511aeavzmigrate: assorted minor cleanups(1) Fix a typo in a comment. (2) Do not log option values, it makes no sense. (3) Do not brake the line shorter than 80 characters. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
37db8116af1vzmigrate: fix loggingCommit ea203fb5bc changed echo to printf because echo -e is not portable. Unfortunately it did it in a bad way: (1) no newline character (2) bad number of arguments to printf Revert it and go back to standard echo. But do not use -e now, fixing a few statements than relied on it by changing \t to spaces. Use $* and put it inside the doubple quotas to save these spaces. Signed-off-by: Kir Ko...
Kir KolyshkinKir Kolyshkin
e5c3327c888vzctl set --ipdel all: fix removing IPs from CTThis is a bit tricky. vps_net_ctl() is called twice -- for ADD and for DEL operations, with different resources ('net' and 'del_net'). The problem is delall flag is only set in 'net' but not in 'del_net'. When vps_net_ctl() is called for DEL it checks that the list of IPs is empty and 'delall' is not set (because it is not set in del_net) so it exits immediately, therefore vps_ip_configure(op=...
Kir KolyshkinKir Kolyshkin
d92b5add7e0vzlist: add support for OSTEMPLATE fieldSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e37bd43d750vzlist: clean up some unneeded RES_ definesDefines RES_NAME, RES_DESCRIPTION, RES_ONBOOT, RES_BOOTORDER and RES_IO are completely unnecessary. Remove them. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3b7ccbb38afsrc/vzlist.c: streamline a few macrosSimplify macro calls by shortening the list of arguments, add some macros to avoid repetition, and rename a few disk quota releated functions. Presumably this does not change the generated code in any way. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
95623c715c7vzlist: fix headers for disk quota fieldsThe appropriate parameters are diskspace and diskinodes, therefore let's name the fields as DSPACE and DINODES, not DQBLOCKS and DQINODES. Fix the man page appropriately. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
34391d42c8evzlist: put similar print_ functions in a macroFunctions print_name(), print_hostname() and print_description() are all monozygotic twins. Create a macro to generate those. While at it, move these functions plus print_ip up in the source file so we no longer need prototypes. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
be3419cd23cman/vzlist.8: fix rendering for ioprio in a tableFix to previous commit 53b271ab1f8880504c3b81297e3b5b778653e737. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
53b271ab1f8vzlist: add ioprio fieldCurrently the value is only obtained from CT config files. We could add support for getting the value from /proc/bc/$CTID/ioprio some time later. http://bugzilla.openvz.org/show_bug.cgi?id=1526 Reported-by: Dennis P. Nikolaenko <dennis@nikolaenko.ru> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
5970e30c9ecparse_ioprio(): reset ioprio if value is invalidIf ioprio value is not within allowed range, do not just report an error, also reset the value to -1 (which means 'unset'). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ada28a5fadcetc/dist/scripts: add missing fedora releasesAdd missing fedora releases, plus a generic fedora.conf name (to avoid future warnings for fedora 14, 15 etc). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9f688269103etc/dists/scripts/*: Get rid of 'echo -e' bashismsApparently using 'echo -e' is non-portable. In these scripts this is harmless since they are to be run by bash (first line specifically says #!/bin/bash). But since -e functionality (i.e. interpretation of backslash sequences line \n and \t) is not required here, just remove '-e' flag. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d50cdb66e59scripts/vpsnetclean: Get rid of 'echo -e' bashismApparently using 'echo -e' is non-portable. More to say, in these two cases -e is not needed, so just remove '-e'. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b863b67b4a9scripts/vpsreboot: use vzlist for list of stopped CTsGet rid of fancy trickery, just use vzlist -H -octid -S Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ea203fb5bc8vzmigrate: Get rid of 'echo -e' bashismApparently using 'echo -e' is non-portable. Replace to printf which is supposed to be portable and understand escape sequences (as recommended by https://wiki.ubuntu.com/DashAsBinSh). http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581147 Reported-by: Raphael Geissert <atomo64@gmail.com> Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
84f31be4f7cvzctl destroy: emit error if failed to rmdir VE_ROOTThis is a fix/addition to the previous commit 560f0a33. It's nice to print errno as well. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
560f0a3347fvzctl destroy: emit warning if unable to remove VE_ROOTVE_ROOT is normally an empty directory, so we call rmdir() on it. But in case it is not empty, or not a directory, rmdir fails. This behavior is totally correct, but it's nice to let the user know about the problem. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
534c681457cvzctl destroy: handle the case when VE_PRIVATE is a symlinkIn case VE_PRIVATE is a symlink let's print its destination and only try to remove the symlink itself, not its destination. Not removing symlink destination is the common-sense policy described in symlink(7) and obeyed by utilities such as rm(3). http://bugzilla.openvz.org/1095 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ee983a5f259Build system: generate files silentlyI.e. use AM_V_GEN for autogenerated files. In case current automake does not support silent build, it will expand to nothing so no harm in any case. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6d91ed06607init.d/vz-redhat: warn user if IP forwarding is offThis was already implemented for Gentoo but not for Red Hat/SUSE/Debian. http://bugzilla.openvz.org/1079 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3b557339dc5init.d/vz-gentoo: simplify check for IP forwardingCommit 2b97841cd25a8088d5b878eeb5420e5509dc142e added checking if IP forwarding is enabled. Use sysctl options to avoid using awk and /dev/null redirection, also explicitly check for value of 1. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
6a6d85c0619init.d/vz-redhat: make it less verboseJust print that we start venet0, no need to report every ip and sysctl action. Also, removed misleading FIXME comment -- address assigned is the correct one. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b94c505e88fvzctl destroy: fix rare off-by-one error in get_destroy_root()In case VE_PRIVATE is a separate file system (say you mount /dev/sda3 to /vz/private/333), or VE_PRIVATE is a symlink to a directory on another filesystem (like /vz/private/333 -> /otherdir/333), function get_destroy_root() should return the same path it is given. Now it cuts the last character as shown below: $ ls -l /vz/private/801 lrwxrwxrwx 1 root root 13 May 12 20:43 /vz/private/801 -> /o...
Kir KolyshkinKir Kolyshkin
36457430addvzctl destroy: try hard to close fds before forking into bgSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
dfaf8ef6bc5vzctl destroy: fix a locking bugIf the lock is already taken we do not need to unlock it, just silently exit (someone else is already doing our job). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1259779eff0vzmigrate: do not try to turn quota off if DISK_QUOTA=offThe bug prevents migrating stopped CT when DISK_QUOTA=off. We check DISK_QUOTA in other places but forgot it here. Initially reported by Valerij Frolov. Initial fix by Marat Stanichenko. http://bugzilla.openvz.org/1094
Kir KolyshkinKir Kolyshkin
ddd83c1e5c2vzctl start: mount /proc and /sys inside CTSome of the modern distros rely on initrd scripts doing this, and since CTs don't have initrd we do it in vzctl. Another reason is commit 98642b9e7a640a9c989898b69870effcbbfb651e which tries to mount to /proc/fs/nfsd so we need to have /proc mounted before. Also, move mk_quota_link to after mounting /proc and such, because it involves /proc (as a link destination so it doesn't really matter b...
Kir KolyshkinKir Kolyshkin
8b0d60b2195vzctl set --features nfsd: recognize itSince feature "nfs" is before "nfsd" in the array of features, we were getting false positive in comparison, then following check for comma was negative and the result is "unknown feature". Fix that by moving the check for comma next to strncmp. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Igor SukhihIgor Sukhih
98642b9e7a6Mount nfsd related stuff on CT start if nfsd feature is enabledThese two: nfsd at /proc/fs/nfsd rpc_pipefs at /var/lib/nfs/rpc_pipefs should be mounted at container boot in order to make nfs startup scripts work.
Kir KolyshkinKir Kolyshkin
dd1bef6ef6cvzctl-lib: raise version numberSince we changed a lot of internals, raise the lib version number. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
7a90b89686dbin/.gitignore: add vznetaddbrCommit 41fb6973bc205c00e25ba73431110ac8e821d6c9 adds vznetaddbr script (autogenerated from vznetaddbr.in), but forgets to add vznetaddbr to .gitignore. Do it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Cyrill GorcunovCyrill Gorcunov
dbae6247831execvep: Use vz_strlcat helperOtherwise we may get stack overwritten. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Kir KolyshkinKir Kolyshkin
673c1a29a70Do not print "Add/Del IP" if no IPAvoid logging "Adding/Deleting IP addresses" if there are none. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
0d59c4f8db2list2str(): removed duplicated statementsp is printed two times, remove the second one. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
2660464e608Enable sysfs feature by defaultMost of the newer distros need it, so enable it. User can still disable it explicitly if needed, by using --features sysfs:off. The feature was not on by default because older kernels used to pin about 2M of kernel memory per sysfs instance for container. Now it's not the case so we can enable it harmlessly. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
5d10b797259Use enum instead of defines for ACTION_sThis makes compiler do some stricter checking, also debugging is easier since you see the name not value. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1df45b29b01Minor cleanupRemoved unused #defines and some commented out code that used those. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Cyrill GorcunovCyrill Gorcunov
80ad89e384eCheck for memory granted by get_dist_nameSigned-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Cyrill GorcunovCyrill Gorcunov
eafaf7f3bb5read_script: Check for memory grantedSigned-off-by: Cyrill Gorcunov <gorcunov@openvz.org>