]> git.proxmox.com Git - vzctl.git/commitdiff
fix config path - do not make backups on destroy
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 17 Nov 2011 07:38:05 +0000 (08:38 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 17 Nov 2011 08:46:13 +0000 (09:46 +0100)
Makefile
debian/changelog
debian/patches/fix-config-path.diff
debian/patches/fix-vznetaddbr-conf-path.diff [deleted file]
debian/patches/no-backup-on-destroy.diff [new file with mode: 0644]
debian/patches/series
debian/rules
debian/vzctl.preinst

index 7daefe35dc80f40eaf3876b6e6d1fad4a2176198..85a9d626920f720352009b466086cd770b879b42 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 RELEASE=2.0
 
 SVER=3.0.29
-PACKAGERELEASE=3pve2
+PACKAGERELEASE=3pve3
 ARCH=amd64
 
 PACKAGE=vzctl
index 3492d2eb5e83326925b00d0fd314ce48e6cfdaa9..438e32fcac4c0df70f146f96b32cade3b48242a0 100644 (file)
@@ -1,3 +1,13 @@
+vzctl (3.0.29-3pve3) unstable; urgency=low
+
+  * fix config path in vzmigrate
+  
+  * symlink /etc/vz/conf to /etc/pve/openvz
+  
+  * do not make backups of config files on destroy
+
+ -- Proxmox Support Team <support@proxmox.com>  Thu, 17 Nov 2011 07:54:34 +0100
+
 vzctl (3.0.29-3pve2) unstable; urgency=low
 
   * fix config path in vznetaddbr
index 76ca48151f64a3d350aa3ec5477f07ceeba2de12..198ba87c1cc761b0388abe98b3caaa0c5cfbf1fe 100644 (file)
@@ -1,7 +1,7 @@
 Index: new/include/types.h
 ===================================================================
---- new.orig/include/types.h   2011-09-26 11:54:22.000000000 +0200
-+++ new/include/types.h        2011-09-26 12:00:55.000000000 +0200
+--- new.orig/include/types.h   2011-11-17 08:05:21.000000000 +0100
++++ new/include/types.h        2011-11-17 08:05:45.000000000 +0100
 @@ -21,7 +21,7 @@
  #define VZ_DIR                        PKGCONFDIR "/"
  #define GLOBAL_CFG            VZ_DIR "vz.conf"
@@ -13,8 +13,8 @@ Index: new/include/types.h
  #define VENAME_DIR            VZ_DIR "names"
 Index: new/paths.am
 ===================================================================
---- new.orig/paths.am  2011-09-26 07:35:16.000000000 +0200
-+++ new/paths.am       2011-09-26 07:36:40.000000000 +0200
+--- new.orig/paths.am  2011-11-17 08:05:21.000000000 +0100
++++ new/paths.am       2011-11-17 08:05:45.000000000 +0100
 @@ -32,7 +32,7 @@
  ifupdir     = $(sysconfdir)/network/if-up.d
  
@@ -24,3 +24,42 @@ Index: new/paths.am
  distconfdir = $(pkgconfdir)/dists
  namesdir    = $(pkgconfdir)/names
  
+Index: new/bin/vznetaddbr.in
+===================================================================
+--- new.orig/bin/vznetaddbr.in 2011-11-17 08:02:47.000000000 +0100
++++ new/bin/vznetaddbr.in      2011-11-17 08:05:45.000000000 +0100
+@@ -2,7 +2,7 @@
+ #
+ # Add virtual network interfaces (veth's) in a container to a bridge on CT0
+-CONFIGFILE=@PKGCONFDIR@/conf/$VEID.conf
++CONFIGFILE=@VPSCONFDIR@/$VEID.conf
+ . $CONFIGFILE
+ NETIFLIST=$(printf %s "$NETIF" |tr ';' '\n')
+Index: new/bin/vzmigrate.in
+===================================================================
+--- new.orig/bin/vzmigrate.in  2011-11-17 08:02:47.000000000 +0100
++++ new/bin/vzmigrate.in       2011-11-17 08:05:45.000000000 +0100
+@@ -31,7 +31,7 @@
+ remove_area=1
+ keep_dst=0
+ debug=0
+-confdir="@PKGCONFDIR@/conf"
++confdir="@VPSCONFDIR@"
+ vzconf="@PKGCONFDIR@/vz.conf"
+ tmpdir="/var/tmp"
+ act_scripts=
+Index: new/etc/init.d/vz-redhat.in
+===================================================================
+--- new.orig/etc/init.d/vz-redhat.in   2011-11-17 08:06:26.000000000 +0100
++++ new/etc/init.d/vz-redhat.in        2011-11-17 08:07:06.000000000 +0100
+@@ -41,7 +41,7 @@
+ . @VZLIBDIR@/initd-functions
+ VZQUOTA=@SBINDIR@/vzquota
+-CONFIG_DIR=@PKGCONFDIR@/conf
++CONFIG_DIR=@VPSCONFDIR@
+ LOCKFILE=$VARLOCK/vz_lock
+ SUBSYS_VZ=$VARLOCK/vz
+ VESTAT=/proc/vz/vestat
diff --git a/debian/patches/fix-vznetaddbr-conf-path.diff b/debian/patches/fix-vznetaddbr-conf-path.diff
deleted file mode 100644 (file)
index e522776..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: new/bin/vznetaddbr.in
-===================================================================
---- new.orig/bin/vznetaddbr.in 2011-10-05 09:03:07.000000000 +0200
-+++ new/bin/vznetaddbr.in      2011-10-05 09:04:15.000000000 +0200
-@@ -2,7 +2,7 @@
- #
- # Add virtual network interfaces (veth's) in a container to a bridge on CT0
--CONFIGFILE=@PKGCONFDIR@/conf/$VEID.conf
-+CONFIGFILE=@VPSCONFDIR@/$VEID.conf
- . $CONFIGFILE
- NETIFLIST=$(printf %s "$NETIF" |tr ';' '\n')
diff --git a/debian/patches/no-backup-on-destroy.diff b/debian/patches/no-backup-on-destroy.diff
new file mode 100644 (file)
index 0000000..60a7971
--- /dev/null
@@ -0,0 +1,45 @@
+Index: new/src/lib/destroy.c
+===================================================================
+--- new.orig/src/lib/destroy.c 2011-11-17 09:23:13.000000000 +0100
++++ new/src/lib/destroy.c      2011-11-17 09:35:20.000000000 +0100
+@@ -295,7 +295,7 @@
+       logger(0, 0, "Destroying container private area: %s", fs->private);
+       if ((ret = vps_destroy_dir(veid, fs->private)))
+               return ret;
+-      move_config(veid, BACKUP);
++      move_config(veid, DESTR_ALL);
+       if (rmdir(fs->root) < 0)
+               logger(-1, errno, "Warning: failed to remove %s", fs->root);
+       logger(0, 0, "Container private area was destroyed");
+Index: new/include/util.h
+===================================================================
+--- new.orig/include/util.h    2011-11-17 09:32:06.000000000 +0100
++++ new/include/util.h 2011-11-17 09:35:31.000000000 +0100
+@@ -25,6 +25,7 @@
+ #define BACKUP                0
+ #define DESTR         1
++#define DESTR_ALL     2
+ #define PROCMEM               "/proc/meminfo"
+ #define PROCTHR               "/proc/sys/kernel/threads-max"
+Index: new/src/lib/util.c
+===================================================================
+--- new.orig/src/lib/util.c    2011-11-17 09:36:31.000000000 +0100
++++ new/src/lib/util.c 2011-11-17 09:38:57.000000000 +0100
+@@ -558,7 +558,14 @@
+       snprintf(conf, sizeof(conf), VPS_CONF_DIR "%d.%s", veid, prefix);
+       snprintf(newconf, sizeof(newconf), "%s." DESTR_PREFIX, conf);
+-      action == BACKUP ? rename(conf, newconf) : unlink(newconf);
++      if (action == BACKUP) {
++              rename(conf, newconf);
++      } else if (action == DESTR_ALL) {
++              unlink(conf);
++              unlink(newconf);
++      } else if (action == DESTR) {
++              unlink(newconf);
++      }
+ }
+ /* Renames or removes CT config and various CT scripts.
index 9714fe7a6abf48500a7351dd68c4789cf624e488..3935cedeb29cd3e5e2b0ddab4d11b37f66c17d8a 100644 (file)
@@ -7,4 +7,4 @@ fix-vzevent-init.patch
 fix-default-template.diff
 fix-udev-path.diff
 fix-config-path.diff
-fix-vznetaddbr-conf-path.diff
+no-backup-on-destroy.diff
index 4e0ff263eb1bd2b355669427cf720acece08fe0c..f988e255adf4c49fea2eeaba7931ffbba1ee3137 100644 (file)
@@ -88,6 +88,11 @@ install: build
        rm -rf $(CURDIR)/debian/vzctl/etc/pve/openvz
        rmdir $(CURDIR)/debian/vzctl/etc/pve
 
+       # remove files in /etc/vz/conf (symlink to /etc/pve/openvz)
+       rm -rf $(CURDIR)/debian/vzctl/etc/vz/conf
+       # we create the symlink to /etc/pve/openvz inside the preinst script
+
+
 
 # Build architecture-independent files here.
 binary-indep: build install
index 95c9956dc5864a511dbc4d51ce1399f57b12e922..cd20bde287a212380838b852bc0f607360533ee2 100644 (file)
@@ -23,6 +23,17 @@ case "$1" in
            rm -f "/etc/network/if-up.d/vzifup-post"
        fi
 
+       # move old config out of the way - newer version
+       # use a symlink to /etc/pve/openvz
+       if [ ! -L "/etc/vz/conf" ]; then
+           if [ -e "/etc/vz/conf.org" ]; then
+               echo "unable to backup existing configuration"
+               exit 1
+           fi
+           mv /etc/vz/conf /etc/vz/conf.org
+           ln -s /etc/pve/openvz /etc/vz/conf
+       fi
+
        # compability mode /var/lib/vz -> /vz
        # ln -sT /var/lib/vz vz 2>/dev/null || true
        # echo "Add a link from /var/lib/vz to /vz/"