Package: vzctl
Version: 3.0.22-14
Severity: wishlist
Tags: patch

``/etc/vz/dists/scripts/debian-add_ip.sh`` generates the virtual machine's
``/etc/network/interfaces`` by appending virtual interface configuration to the
VM's ``/etc/network/interfaces.template``.  Besides the name being quite
misleading (it's not a template at all), there are serious problems if one just
wants to enable an additional interface *after* the other ones (e.g. for
setting a new alias on ``venet0`` for private communication with the host).

The attached patch enables the use of ``/etc/network/interfaces.head`` as well
as ``/etc/network/interfaces.tail``.  The first one is appended to the
resulting ``interfaces`` file *before* the virtual interface info (and before
the so-called "template"), and the second one is appended at the end.

Thanks!

-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=ca_ES.UTF-8, LC_CTYPE=ca_ES.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages vzctl depends on:
ii  iproute                     20080725-2   networking and traffic control too
ii  libc6                       2.7-18       GNU C Library: Shared libraries
ii  vzquota                     3.0.11-1iti1 server virtualization solution - q

Versions of packages vzctl recommends:
ii  rsync                         3.0.5-1    fast remote file copy program (lik

Versions of packages vzctl suggests:
pn  linux-patch-openvz            <none>     (no description available)

-- no debconf information
--- debian-add_ip.sh.orig	2009-02-03 09:15:06.000000000 +0100
+++ debian-add_ip.sh	2009-02-03 09:16:58.000000000 +0100
@@ -39,6 +39,10 @@
 # Please edit template $CFGFILE.template instead.
 " > ${CFGFILE}
 
+	if [ -f ${CFGFILE}.head ]; then
+		cat ${CFGFILE}.head >> ${CFGFILE}
+	fi
+
 	if [ -f ${CFGFILE}.template ]; then
 		cat ${CFGFILE}.template >> ${CFGFILE}
 	fi
@@ -64,6 +68,10 @@
 
 	fi
 
+	if [ -f ${CFGFILE}.tail ]; then
+		cat ${CFGFILE}.tail >> ${CFGFILE}
+	fi
+
 	# Set up /etc/hosts
 	if [ ! -f $HOSTFILE ]; then
 		echo "127.0.0.1 localhost.localdomain localhost" > $HOSTFILE

Reply via email to