[pve-devel] r4939 - in vzctl/trunk: . debian debian/patches

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Aug 6 11:56:06 CEST 2010


Author: dietmar
Date: 2010-08-06 09:56:06 +0000 (Fri, 06 Aug 2010)
New Revision: 4939

Added:
   vzctl/trunk/debian/patches/
   vzctl/trunk/debian/patches/fix-configure.patch
   vzctl/trunk/debian/patches/fix-init-script.patch
   vzctl/trunk/debian/patches/fix-redhat-add-ip.patch
   vzctl/trunk/debian/patches/initlog.patch
   vzctl/trunk/debian/patches/revert-vzgetnetdev-awk-fix.patch
   vzctl/trunk/debian/patches/series
Removed:
   vzctl/trunk/fix-configure.diff
   vzctl/trunk/hostname.diff
   vzctl/trunk/init-script.diff
   vzctl/trunk/pwhack.diff
   vzctl/trunk/revert-vzgetnetdev-awk-fix.diff
   vzctl/trunk/vzctl.diff
Modified:
   vzctl/trunk/Makefile
   vzctl/trunk/debian/changelog
   vzctl/trunk/debian/control
   vzctl/trunk/debian/rules
Log:
use quilt


Modified: vzctl/trunk/Makefile
===================================================================
--- vzctl/trunk/Makefile	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/Makefile	2010-08-06 09:56:06 UTC (rev 4939)
@@ -1,16 +1,12 @@
 RELEASE=1.6
 
 SVER=3.0.24
-PACKAGERELEASE=1pve1
+PACKAGERELEASE=1pve2
 ARCH=amd64
 
 PACKAGE=vzctl
 DEB=${PACKAGE}_${SVER}-${PACKAGERELEASE}_${ARCH}.deb
 
-# Fri, 22 Jan 2010 16:39:56 +0000
-#VZCTL_BRANCH=346b5152e255b473588a870ec081f9edaba6a786
-# Thu Apr 22 14:39:01 2010 -0700
-#VZCTL_BRANCH=43b15e82d4d492415ca0f8c0e8bdc3fae6a5e94a
 # Fri, 23 Jul 2010 21:02:51 +0000 (01:02 +0400)
 VZCTL_BRANCH=da3a3669e182092b50a6e6a428da8620e69a0de9
 
@@ -29,55 +25,16 @@
 
 vzctl-${SVER}/debian/control: vzctl-${SVER}.org/COPYING
 	rm -rf vzctl-${SVER}
-	cp -av vzctl-${SVER}.org vzctl-${SVER}
-	cp -av debian vzctl-${SVER}/debian
-	cd vzctl-${SVER}; patch -p 1 <../vzctl.diff
-	#cd vzctl-${SVER}; patch -p 1 <../revert-bug-478-fix.diff
-	cd vzctl-${SVER}; patch -p 1 <../fix-configure.diff
-	cd vzctl-${SVER}; patch -p 1 <../init-script.diff
-	#cd vzctl-${SVER}; patch -p 1 <../hostname.diff
-	#cd vzctl-${SVER}; patch -p 1 <../pwhack.diff
-	cd vzctl-${SVER}; patch -p 1 <../revert-vzgetnetdev-awk-fix.diff
+	rsync -av --exclude .git vzctl-${SVER}.org/ vzctl-${SVER}
+	rsync -av --exclude .svn debian/ vzctl-${SVER}/debian
 	cd vzctl-${SVER}; ./autogen.sh
 	touch $@
 
-init-logger: init-logger.c
-	diet -Os gcc -static -s -o init-logger init-logger.c
-
-${DEB}: vzctl-${SVER}/debian/control init-logger
+${DEB}: vzctl-${SVER}/debian/control
 	chmod +x vzctl-${SVER}/debian/rules
-	cp init-logger vzctl-${SVER}/scripts
 	cd vzctl-${SVER}; dpkg-buildpackage -b -rfakeroot -us -uc
 	lintian ${DEB}
 
-hostname.diff:
-	-diff -r -u vzctl-${SVER}.org/etc/dists/scripts/debian-set_hostname.sh vzctl-${SVER}/etc/dists/scripts/debian-set_hostname.sh > $@
-	-diff -r -u vzctl-${SVER}.org/etc/dists/scripts/redhat-set_hostname.sh vzctl-${SVER}/etc/dists/scripts/redhat-set_hostname.sh >> $@
-	-diff -r -u vzctl-${SVER}.org/etc/dists/scripts/gentoo-set_hostname.sh vzctl-${SVER}/etc/dists/scripts/gentoo-set_hostname.sh >> $@
-	-diff -r -u vzctl-${SVER}.org/etc/dists/scripts/slackware-set_hostname.sh vzctl-${SVER}/etc/dists/scripts/slackware-set_hostname.sh >> $@
-	-diff -r -u vzctl-${SVER}.org/etc/dists/scripts/suse-set_hostname.sh vzctl-${SVER}/etc/dists/scripts/suse-set_hostname.sh >> $@
-
-vzctl.diff:
-	-diff -r -u vzctl-${SVER}.org/src/lib/veth.c vzctl-${SVER}/src/lib/veth.c > $@
-	-diff -r -u vzctl-${SVER}.org/include/veth.h vzctl-${SVER}/include/veth.h >> $@
-	-diff -r -u vzctl-${SVER}.org/src/lib/env.c vzctl-${SVER}/src/lib/env.c >> $@
-	-diff -r -u vzctl-${SVER}.org/src/lib/config.c vzctl-${SVER}/src/lib/config.c >> $@
-	-diff -r -u vzctl-${SVER}.org/scripts/Makefile.am vzctl-${SVER}/scripts/Makefile.am >> $@
-	-diff -r -u vzctl-${SVER}.org/etc/vz.conf vzctl-${SVER}/etc/vz.conf >> $@
-	-diff -r -u vzctl-${SVER}.org/include/res.h vzctl-${SVER}/include/res.h >> $@
-	-diff -r -u vzctl-${SVER}.org/include/vzctl_param.h vzctl-${SVER}/include/vzctl_param.h >> $@
-	-diff -r -u vzctl-${SVER}.org/vzctl.spec vzctl-${SVER}/vzctl.spec >> $@
-	-diff -r -u vzctl-${SVER}.org/man/ctid.conf.5 vzctl-${SVER}/man/ctid.conf.5 >> $@
-
-pwhack.diff:
-	-diff -r -u vzctl-${SVER}/src/lib/create.c nvzctl-${SVER}/src/lib/create.c > $@
-	-diff -r -u vzctl-${SVER}/src/lib/config.c nvzctl-${SVER}/src/lib/config.c >> $@
-	-diff -r -u vzctl-${SVER}/src/Makefile.am nvzctl-${SVER}/src/Makefile.am>> $@
-	-diff -r -u vzctl-${SVER}/src/vzctl-actions.c nvzctl-${SVER}/src/vzctl-actions.c >> $@
-	-diff -r -u vzctl-${SVER}/include/create.h nvzctl-${SVER}/include/create.h>> $@
-	-diff -r -u vzctl-${SVER}/include/vzctl_param.h nvzctl-${SVER}/include/vzctl_param.h >> $@
-	-diff -r -u vzctl-${SVER}/include/res.h nvzctl-${SVER}/include/res.h >> $@
-
 .PHONY: upload
 upload: vzctl-${SVER}.tgz ${DEB}
 	umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw 
@@ -96,4 +53,4 @@
 
 .PHONY: clean
 clean:
-	rm -rf vzctl-${SVER} vzctl_${SVER}* *~ debian/*~ *.tmp a.out init-logger
\ No newline at end of file
+	rm -rf vzctl-${SVER} vzctl_${SVER}* *~ debian/*~ debian/patches/*~ *.tmp a.out

Modified: vzctl/trunk/debian/changelog
===================================================================
--- vzctl/trunk/debian/changelog	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/debian/changelog	2010-08-06 09:56:06 UTC (rev 4939)
@@ -1,3 +1,11 @@
+vzctl (3.0.24-1pve2) unstable; urgency=low
+
+  * correctly call ldconfig in postinst/postrm
+  
+  * use quilt to manage patches
+
+ -- Proxmox Support Team <support at proxmox.com>  Fri, 06 Aug 2010 11:52:00 +0200
+
 vzctl (3.0.24-1pve1) unstable; urgency=low
 
   * upgrade to latest version from git
@@ -10,8 +18,6 @@
   * sysctl: set "net.ipv4.ip_forward = 1" - seems to be needed by newer
     kernels
   
-  * correctly call ldconfig in postinst/postrm
-
  -- Proxmox Support Team <support at proxmox.com>  Thu, 05 Aug 2010 10:43:16 +0200
 
 vzctl (3.0.23-1pve11) unstable; urgency=low

Modified: vzctl/trunk/debian/control
===================================================================
--- vzctl/trunk/debian/control	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/debian/control	2010-08-06 09:56:06 UTC (rev 4939)
@@ -2,7 +2,7 @@
 Section: admin
 Priority: optional
 Maintainer: Proxmox Support Team <support at proxmox.com>
-Build-Depends: debhelper (>= 5)
+Build-Depends: debhelper (>= 5), quilt, dietlibc-dev
 Standards-Version: 3.7.2
 
 Package: vzctl

Added: vzctl/trunk/debian/patches/fix-configure.patch
===================================================================
--- vzctl/trunk/debian/patches/fix-configure.patch	                        (rev 0)
+++ vzctl/trunk/debian/patches/fix-configure.patch	2010-08-06 09:56:06 UTC (rev 4939)
@@ -0,0 +1,13 @@
+Index: vzctlnew/configure.ac
+===================================================================
+--- vzctlnew.orig/configure.ac	2010-08-06 11:38:20.000000000 +0200
++++ vzctlnew/configure.ac	2010-08-06 11:38:25.000000000 +0200
+@@ -51,6 +51,8 @@
+ AC_PROG_LIBTOOL
+ AC_PROG_INSTALL
+ AC_PROG_LN_S
++AC_PROG_MKDIR_P
++AC_SUBST([MKDIR_P])
+ 
+ # Checks for libraries.
+ AC_CHECK_LIB(dl, dlopen,

Added: vzctl/trunk/debian/patches/fix-init-script.patch
===================================================================
--- vzctl/trunk/debian/patches/fix-init-script.patch	                        (rev 0)
+++ vzctl/trunk/debian/patches/fix-init-script.patch	2010-08-06 09:56:06 UTC (rev 4939)
@@ -0,0 +1,15 @@
+Index: vzctlnew/etc/init.d/vz-redhat.in
+===================================================================
+--- vzctlnew.orig/etc/init.d/vz-redhat.in	2010-08-06 11:39:32.000000000 +0200
++++ vzctlnew/etc/init.d/vz-redhat.in	2010-08-06 11:39:41.000000000 +0200
+@@ -185,8 +185,8 @@
+ check_kernel()
+ {
+ 	if ! test -d /proc/vz ; then
+-		print_failure "Running kernel is not OpenVZ kernel."
+-		exit 1
++		print_result "Running kernel is not OpenVZ kernel."
++		exit 0
+ 	fi
+ }
+ 

Added: vzctl/trunk/debian/patches/fix-redhat-add-ip.patch
===================================================================
--- vzctl/trunk/debian/patches/fix-redhat-add-ip.patch	                        (rev 0)
+++ vzctl/trunk/debian/patches/fix-redhat-add-ip.patch	2010-08-06 09:56:06 UTC (rev 4939)
@@ -0,0 +1,13 @@
+Index: vzctlnew/etc/dists/scripts/redhat-add_ip.sh
+===================================================================
+--- vzctlnew.orig/etc/dists/scripts/redhat-add_ip.sh	2010-08-06 10:45:36.000000000 +0200
++++ vzctlnew/etc/dists/scripts/redhat-add_ip.sh	2010-08-06 10:46:01.000000000 +0200
+@@ -56,7 +56,7 @@
+ 	# Set /etc/sysconfig/network
+ 	put_param $NETFILE NETWORKING yes
+ 	# Set default route to venet0
+-	put_param $NETFILE GATEWAYDEV ${VENETDEV}
++	put_param $NETFILE GATEWAYDEV ${VENET_DEV}
+ 	# Remove old (obsoleted) fake route
+ 	del_param $NETFILE GATEWAY
+ 	[ -f "${IFCFG_DIR}/route-venet0" ] && rm -f ${IFCFG_DIR}/route-venet0

Added: vzctl/trunk/debian/patches/initlog.patch
===================================================================
--- vzctl/trunk/debian/patches/initlog.patch	                        (rev 0)
+++ vzctl/trunk/debian/patches/initlog.patch	2010-08-06 09:56:06 UTC (rev 4939)
@@ -0,0 +1,402 @@
+Index: vzctlnew/etc/vz.conf
+===================================================================
+--- vzctlnew.orig/etc/vz.conf	2010-08-06 11:34:48.000000000 +0200
++++ vzctlnew/etc/vz.conf	2010-08-06 11:36:10.000000000 +0200
+@@ -10,6 +10,9 @@
+ LOG_LEVEL=0
+ VERBOSE=0
+ 
++## log output of init process to $VE_ROOT/var/log/init.log
++INITLOG=yes
++
+ ## Disk quota parameters
+ DISK_QUOTA=yes
+ VZFASTBOOT=no
+Index: vzctlnew/include/res.h
+===================================================================
+--- vzctlnew.orig/include/res.h	2010-08-06 11:35:05.000000000 +0200
++++ vzctlnew/include/res.h	2010-08-06 11:36:10.000000000 +0200
+@@ -55,6 +55,7 @@
+ 	int onboot;
+ 	unsigned long *bootorder;
+ 	int wait;
++	int initlog;
+ } misc_param;
+ 
+ struct mod_action;
+Index: vzctlnew/include/vzctl_param.h
+===================================================================
+--- vzctlnew.orig/include/vzctl_param.h	2010-08-06 11:35:15.000000000 +0200
++++ vzctlnew/include/vzctl_param.h	2010-08-06 11:36:10.000000000 +0200
+@@ -132,6 +132,7 @@
+ #define PARAM_DESCRIPTION	362
+ #define PARAM_SWAPPAGES		363
+ #define PARAM_BOOTORDER		364
++#define PARAM_INITLOG		365
+ 
+ #define PARAM_LINE		"e:p:f:t:i:l:k:a:b:n:x:h"
+ #endif
+Index: vzctlnew/man/ctid.conf.5
+===================================================================
+--- vzctlnew.orig/man/ctid.conf.5	2010-08-06 11:35:29.000000000 +0200
++++ vzctlnew/man/ctid.conf.5	2010-08-06 11:37:13.000000000 +0200
+@@ -28,6 +28,13 @@
+ Default is \fBno\fR, meaning the container will not be started
+ if \fBONBOOT\fR parameter is omitted.
+ Corresponds to the \fB--onboot\fR option.
++.IP \fBINITLOG\fR="\fByes\fR|\fBno\fR"
++If enabled init output is logged to /var/log/init.log. This is done by
++opening a BSD pseudo terminal device. A new /dev/console is created and points
++to that pseudo terminal slave. An additional process started
++inside the container (init-logger) reads the master and write results
++to /var/log/init.log.
++Corresponds to the \fB--initlog\fR option.
+ .IP \fBBOOTORDER\fR="\fInumber\fR"
+ Specifies the CT boot order priority. Corresponds to the
+ \fB--bootorder\fR option.
+Index: vzctlnew/scripts/Makefile.am
+===================================================================
+--- vzctlnew.orig/scripts/Makefile.am	2010-08-06 11:34:31.000000000 +0200
++++ vzctlnew/scripts/Makefile.am	2010-08-06 11:44:18.000000000 +0200
+@@ -17,7 +17,11 @@
+ 
+ include $(top_srcdir)/pathsubst.am
+ 
++init-logger: init-logger.c
++	diet -Os gcc -static -s -o init-logger init-logger.c
++
+ vzlib_SCRIPTS = \
++        init-logger \
+ 	vps-create \
+ 	vps-functions \
+ 	vps-net_add \
+Index: vzctlnew/src/lib/config.c
+===================================================================
+--- vzctlnew.orig/src/lib/config.c	2010-08-06 11:34:00.000000000 +0200
++++ vzctlnew/src/lib/config.c	2010-08-06 11:36:10.000000000 +0200
+@@ -60,6 +60,7 @@
+ {"LOG_LEVEL",	NULL, PARAM_LOGLEVEL},
+ {"LOGFILE",	NULL, PARAM_LOGFILE},
+ {"VERBOSE",	NULL, PARAM_VERBOSE},
++{"INITLOG",	NULL, PARAM_INITLOG},
+ 
+ {"IPTABLES",	NULL, PARAM_IPTABLES},
+ /*	UB	*/
+@@ -116,6 +117,8 @@
+ {"CPUUWEIGHT",	NULL, PARAM_CPUWEIGHT},
+ {"CPULIMIT",	NULL, PARAM_CPULIMIT},
+ {"CPUS",	NULL, PARAM_VCPUS},
++/*      misc param     */
++{"INITLOG",	NULL, PARAM_INITLOG},
+ /* create param	*/
+ {"ONBOOT",	NULL, PARAM_ONBOOT},
+ {"CONFIGFILE",	NULL, PARAM_CONFIG},
+@@ -1104,6 +1107,9 @@
+ 
+ 	ret = 0;
+ 	switch (conf->id) {
++	case PARAM_INITLOG:
++		ret = conf_store_yesno(conf_h, conf->name, misc->initlog);
++		break;
+ 	case PARAM_ONBOOT:
+ 		ret = conf_store_yesno(conf_h, conf->name, misc->onboot);
+ 		break;
+@@ -1704,6 +1710,9 @@
+ 	case PARAM_LOGGING:
+ 		ret = conf_parse_yesno(&vps_p->log.enable, val);
+ 		break;
++	case PARAM_INITLOG:
++		ret = conf_parse_yesno(&vps_p->res.misc.initlog, val);
++		break;
+ 	case PARAM_LOGLEVEL:
+ 		if (parse_int(val, &int_id))
+ 			break;
+@@ -2502,6 +2511,7 @@
+ 	MERGE_INT(onboot)
+ 	MERGE_P(bootorder)
+ 	MERGE_INT(wait)
++	MERGE_INT(initlog)
+ }
+ 
+ static void merge_dq(dq_param *dst, dq_param *src)
+Index: vzctlnew/src/lib/env.c
+===================================================================
+--- vzctlnew.orig/src/lib/env.c	2010-08-06 11:33:37.000000000 +0200
++++ vzctlnew/src/lib/env.c	2010-08-06 11:36:56.000000000 +0200
+@@ -23,6 +23,7 @@
+ #include <signal.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
++#include <sys/stat.h>
+ #include <sys/wait.h>
+ #include <string.h>
+ #include <grp.h>
+@@ -280,7 +281,7 @@
+ 	int fd, ret;
+ 	vps_res *res;
+ 	char *argv[] = {"init", "-z", "      ", NULL};
+-	char *envp[] = {"HOME=/", "TERM=linux", NULL};
++	char *envp[] = {"HOME=/", "TERM=linux", NULL, NULL};
+ 
+ 	res = (vps_res *) data;
+ 	memset(&create_param, 0, sizeof(create_param));
+@@ -382,12 +383,65 @@
+ 	*/
+ 	if (read(wait_p, &ret, sizeof(ret)) != 0)
+ 		return 0;
+-	if ((fd = open("/dev/null", O_RDWR)) != -1) {
+-		dup2(fd, 0);
+-		dup2(fd, 1);
+-		dup2(fd, 2);
+-	}
++
+ 	logger(10, 0, "Starting init");
++
++	if (((fd = open("/dev/null", O_RDWR)) != -1) && (fd == STDIN_FILENO)) {
++
++		dup2(fd, 1); // STDOUT = /dev/null
++		dup2(fd, 2); // STDERR = /dev/null
++
++		if (res->misc.initlog == 1) {
++		        int pid;
++
++			if (!((mkfifo ("/var/log/init.fifo", 0600) == 0) || (errno == EEXIST))) {
++			        logger(-1, errno, "unable to create init fifo");
++				return 0;
++			}
++
++			// create new /dev/console ==> /var/log/init.fifo
++			unlink ("/dev/console");
++			symlink ("/var/log/init.fifo", "/dev/console");
++
++			pid = fork();
++
++			if (pid == -1) {
++			        logger(-1, errno, "unable to fork init-logger");
++				return 0;
++			}
++
++			if (!pid) {
++
++			        close(wait_p); close(err_p);
++
++				/* Note: open fifo RDWR to avoid EOF */
++				close(STDIN_FILENO);
++				open("/var/log/init.fifo", O_RDWR);
++
++				close(STDOUT_FILENO);
++				open("/var/log/init.log", O_CREAT|O_WRONLY|O_TRUNC);
++
++				close(STDERR_FILENO);
++				dup2(STDOUT_FILENO, STDERR_FILENO);
++
++				execl("/sbin/init-logger", NULL);
++				exit (-1);
++			}
++
++			close(STDOUT_FILENO);
++			if (open("/var/log/init.fifo", O_WRONLY) == -1) {
++			        logger(-1, errno, "open init.fifo failed");
++				return 0;
++			}
++
++			close(STDERR_FILENO);
++			dup2(STDOUT_FILENO, STDERR_FILENO);
++
++			// tell init to use /var/log/init.fifo
++			envp[2] = "CONSOLE=/var/log/init.fifo";
++		}
++	}
++
+ 	execve("/sbin/init", argv, envp);
+ 	execve("/etc/init", argv, envp);
+ 	execve("/bin/init", argv, envp);
+@@ -403,6 +457,20 @@
+ {
+ 	int ret, pid;
+ 
++        char ildest[4096];
++
++        *ildest = 0;
++        strcat (ildest, res->fs.root);
++        strcat (ildest, "/sbin/init");
++
++        *ildest = 0;
++        strcat (ildest, res->fs.root);
++        strcat (ildest, "/sbin/init-logger");
++        if (cp_file (ildest, "/usr/lib/vzctl/scripts/init-logger") != 0) {
++                logger(-1, 0, "Unable to copy init-logger");
++                return VZ_RESOURCE_ERROR;
++        }
++
+ 	if ((ret = vz_chroot(res->fs.root)))
+ 		return ret;
+ 	if ((ret = vz_setluid(veid)))
+Index: vzctlnew/scripts/init-logger.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ vzctlnew/scripts/init-logger.c	2010-08-06 11:45:28.000000000 +0200
+@@ -0,0 +1,163 @@
++/*
++
++     Copyright (C) 2008 Proxmox Server Solutions GmbH
++
++     This program is free software; you can redistribute it and/or modify
++     it under the terms of the GNU General Public License as published by
++     the Free Software Foundation; version 2 dated June, 1991.
++
++     This program is distributed in the hope that it will be useful,
++     but WITHOUT ANY WARRANTY; without even the implied warranty of
++     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++     GNU General Public License for more details.
++
++     You should have received a copy of the GNU General Public License
++     along with this program; if not, write to the Free Software Foundation,
++     Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
++     You should have received a copy of the GNU General Public License
++
++     Author: Dietmar Maurer <dietmar at proxmox.com>
++
++     Compile statically using dietlibc:
++     diet -Os gcc -static -s -o init-logger.ARCH init-logger.c
++*/
++
++#include <sys/types.h>
++#include <sys/wait.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <errno.h>
++#include <stdio.h>
++#include <signal.h>
++#include <sys/select.h>
++
++/* Set a signal handler */
++static void
++setsig(struct sigaction *sa, int sig,
++		   void (*fun)(int), int flags)
++{
++	sa->sa_handler = fun;
++	sa->sa_flags = flags;
++	sigemptyset(&sa->sa_mask);
++	sigaction(sig, sa, NULL);
++}
++
++static int terminate = 0;
++
++void
++term_handler()
++{
++	terminate = 1;
++}
++
++ssize_t
++safe_read (int fd, char *buf, size_t count)
++{
++	ssize_t n;
++
++	do {
++		n = read (fd, buf, count);
++	} while (n < 0 && errno == EINTR);
++
++	return n;
++}
++
++ssize_t
++safe_write (int fd, char *buf, size_t count)
++{
++	ssize_t n;
++
++	do {
++		n = write (fd, buf, count);
++	} while (n < 0 && errno == EINTR);
++
++	return n;
++}
++
++int
++full_write(int fd, char *buf, size_t len)
++{
++	size_t n;
++	size_t total;
++
++	total = 0;
++
++	while (len > 0) {
++	        n = safe_write(fd, buf, len);
++
++		if (n < 0)
++		        break;
++
++		buf += n;
++		total += n;
++		len -= n;
++	}
++
++	return total;
++}
++
++static void
++simple_cat (void)
++{
++        int bufsize = 256;
++	char buf[bufsize];
++	size_t n_read;
++	int noop_count = 0;
++
++	fd_set rfds;
++	struct timeval tv;
++	int retval;
++
++	FD_ZERO(&rfds);
++	FD_SET(STDIN_FILENO, &rfds);
++
++	tv.tv_sec = 1;
++	tv.tv_usec = 0;
++
++	while ((retval = select(STDIN_FILENO + 1, &rfds, NULL, NULL, &tv)) >= 0 ||
++	       (errno == EINTR)) {
++
++		tv.tv_sec = 1;
++		tv.tv_usec = 0;
++
++		FD_ZERO(&rfds);
++		FD_SET(STDIN_FILENO, &rfds);
++
++		if (retval == -1 && errno == EINTR)
++		    continue;
++
++		if (retval) {
++			n_read = safe_read (STDIN_FILENO, buf, bufsize);
++			if (n_read ==  ((size_t) -1))
++				return;
++
++			noop_count = 0;
++
++			if (full_write (STDOUT_FILENO, buf, n_read) != n_read)
++				return;
++		} else {
++			if (terminate)
++				noop_count++;
++		}
++
++		if (noop_count >= 2)
++			return;
++	}
++}
++
++int
++main(int argc, char * argv[])
++{
++	struct sigaction sa;
++
++	setsig(&sa, SIGTERM, term_handler, SA_RESTART);
++	setsig(&sa, SIGINT, term_handler, SA_RESTART);
++
++	printf ("starting init logger\n");
++
++	simple_cat();
++
++	printf ("\ninit logger finished\n");
++
++	exit (0);
++}

Added: vzctl/trunk/debian/patches/revert-vzgetnetdev-awk-fix.patch
===================================================================
--- vzctl/trunk/debian/patches/revert-vzgetnetdev-awk-fix.patch	                        (rev 0)
+++ vzctl/trunk/debian/patches/revert-vzgetnetdev-awk-fix.patch	2010-08-06 09:56:06 UTC (rev 4939)
@@ -0,0 +1,14 @@
+Index: vzctlnew/scripts/vps-functions.in
+===================================================================
+--- vzctlnew.orig/scripts/vps-functions.in	2010-08-06 11:40:31.000000000 +0200
++++ vzctlnew/scripts/vps-functions.in	2010-08-06 11:40:41.000000000 +0200
+@@ -100,8 +100,7 @@
+ 	/^[0-9]+: / {
+ 		dev="";
+ 	}
+-	/^[0-9]+: / && /\<UP\>/ && !/\<LOOPBACK\>/ \
+-			&& !/\<SLAVE\>/ && !/\<NOARP\>/ {
++	/^[0-9]+: / && /UP/ && !/LOOPBACK/ && !/SLAVE/ && !/NOARP/ {
+ 		if ($2 !~ /^veth[0-9]+/)
+ 			dev=$2;
+ 	}

Added: vzctl/trunk/debian/patches/series
===================================================================
--- vzctl/trunk/debian/patches/series	                        (rev 0)
+++ vzctl/trunk/debian/patches/series	2010-08-06 09:56:06 UTC (rev 4939)
@@ -0,0 +1,5 @@
+fix-redhat-add-ip.patch
+initlog.patch
+fix-configure.patch
+fix-init-script.patch
+revert-vzgetnetdev-awk-fix.patch

Modified: vzctl/trunk/debian/rules
===================================================================
--- vzctl/trunk/debian/rules	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/debian/rules	2010-08-06 09:56:06 UTC (rev 4939)
@@ -11,6 +11,10 @@
 VZCTL_DEBVERSION    ?= $(shell dpkg-parsechangelog | grep ^Version | sed "s/Version: //")
 VZCTL_VERSION       ?= $(shell echo $(VZCTL_DEBVERSION) | cut -d '-' -f 1)
 
+ifneq "$(wildcard /usr/share/quilt/quilt.make)" ""
+include /usr/share/quilt/quilt.make
+endif
+
 CFLAGS = -Wall -g
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -32,13 +36,13 @@
 	    --enable-logrotate  	\
 	    CFLAGS="$(CFLAGS)"
 
-build: build-stamp
+build: patch build-stamp
 build-stamp:  config.status
 	dh_testdir
 	$(MAKE) vzdir=/var/lib/vz
 	touch $@
 
-clean: 
+clean: unpatch
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp 

Deleted: vzctl/trunk/fix-configure.diff
===================================================================
--- vzctl/trunk/fix-configure.diff	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/fix-configure.diff	2010-08-06 09:56:06 UTC (rev 4939)
@@ -1,11 +0,0 @@
---- vzctl-3.0.23.org/configure.ac	2010-01-04 12:55:10.000000000 +0100
-+++ vzctl-3.0.23/configure.ac	2010-01-04 13:39:33.000000000 +0100
-@@ -51,6 +51,8 @@
- AC_PROG_LIBTOOL
- AC_PROG_INSTALL
- AC_PROG_LN_S
-+AC_PROG_MKDIR_P
-+AC_SUBST([MKDIR_P])
- 
- # Checks for libraries.
- AC_CHECK_LIB(dl, dlopen,

Deleted: vzctl/trunk/hostname.diff
===================================================================
--- vzctl/trunk/hostname.diff	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/hostname.diff	2010-08-06 09:56:06 UTC (rev 4939)
@@ -1,62 +0,0 @@
---- vzctl-3.0.23.org/etc/dists/scripts/debian-set_hostname.sh	2008-12-16 10:04:40.000000000 +0100
-+++ vzctl-3.0.23/etc/dists/scripts/debian-set_hostname.sh	2009-01-02 10:15:43.000000000 +0100
-@@ -24,7 +24,10 @@
- 	local hostname=$2
- 
- 	[ -z "${hostname}" ] && return 0
--	echo "${hostname}" > /etc/hostname
-+
-+	hostname=${hostname%%.*}
-+
-+	echo "${hostname}" > ${cfgfile}
- 	hostname ${hostname}
- }
- 
---- vzctl-3.0.23.org/etc/dists/scripts/redhat-set_hostname.sh	2008-12-16 10:04:40.000000000 +0100
-+++ vzctl-3.0.23/etc/dists/scripts/redhat-set_hostname.sh	2009-01-02 10:01:26.000000000 +0100
-@@ -25,6 +25,9 @@
- 	local val=$3
- 
- 	[ -z "${val}" ] && return 0
-+
-+	val=${val%%.*}
-+
- 	put_param "${cfgfile}" "${var}" "${val}"
- 
- 	hostname "${val}"
---- vzctl-3.0.23.org/etc/dists/scripts/gentoo-set_hostname.sh	2008-12-16 10:04:40.000000000 +0100
-+++ vzctl-3.0.23/etc/dists/scripts/gentoo-set_hostname.sh	2009-01-02 10:01:26.000000000 +0100
-@@ -38,6 +38,9 @@
- 	local hostname=$2
- 
- 	[ -z "${hostname}" ] && return 0
-+
-+	hostname=${hostname%%.*}
-+
- 	if is_openrc ; then
- 		if grep -qe "^HOSTNAME=" ${cfgfile} >/dev/null 2>&1; then
- 			del_param ${cfgfile} "HOSTNAME"
---- vzctl-3.0.23.org/etc/dists/scripts/slackware-set_hostname.sh	2008-12-16 10:04:40.000000000 +0100
-+++ vzctl-3.0.23/etc/dists/scripts/slackware-set_hostname.sh	2009-01-02 10:01:26.000000000 +0100
-@@ -24,6 +24,9 @@
- 	local hostname=$2
- 
- 	[ -z "${hostname}" ] && return 0
-+
-+	hostname=${hostname%%.*}
-+
- 	echo "${hostname}" > ${cfgfile}
- 
- 	hostname ${hostname}
---- vzctl-3.0.23.org/etc/dists/scripts/suse-set_hostname.sh	2008-12-16 10:04:40.000000000 +0100
-+++ vzctl-3.0.23/etc/dists/scripts/suse-set_hostname.sh	2009-01-02 10:01:26.000000000 +0100
-@@ -24,6 +24,9 @@
- 	local hostname=$2
- 
- 	[ -z "${hostname}" ] && return 0
-+
-+	hostname=${hostname%%.*}
-+
- 	echo "${hostname}" > ${cfgfile}
- 
- 	hostname ${hostname}

Deleted: vzctl/trunk/init-script.diff
===================================================================
--- vzctl/trunk/init-script.diff	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/init-script.diff	2010-08-06 09:56:06 UTC (rev 4939)
@@ -1,13 +0,0 @@
---- vzctl-3.0.23/etc/init.d/vz-redhat.in.org	2010-01-12 09:05:09.000000000 +0100
-+++ vzctl-3.0.23/etc/init.d/vz-redhat.in	2010-01-12 09:06:43.000000000 +0100
-@@ -185,8 +185,8 @@
- check_kernel()
- {
- 	if ! test -d /proc/vz ; then
--		print_failure "Running kernel is not OpenVZ kernel."
--		exit 1
-+		print_result "Running kernel is not OpenVZ kernel."
-+		exit 0
- 	fi
- }
- 

Deleted: vzctl/trunk/pwhack.diff
===================================================================
--- vzctl/trunk/pwhack.diff	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/pwhack.diff	2010-08-06 09:56:06 UTC (rev 4939)
@@ -1,173 +0,0 @@
---- vzctl-3.0.22/src/lib/create.c	2008-10-28 12:41:06.000000000 +0100
-+++ nvzctl-3.0.22/src/lib/create.c	2008-11-06 13:59:42.000000000 +0100
-@@ -27,6 +27,8 @@
- #include <string.h>
- #include <signal.h>
- #include <sys/wait.h>
-+#include <sys/time.h>
-+#include <time.h>
- 
- #include "list.h"
- #include "logger.h"
-@@ -253,7 +255,9 @@
- 		logger(-1, 0, "Creation of container private area failed");
- 		return ret;
- 	}
--	vps_postcreate(veid, &vps_p->res.fs, &vps_p->res.tmpl);
-+
-+	vps_postcreate(veid, &vps_p->res.fs, &vps_p->res.tmpl,
-+		       cmd_p->res.misc.rootpw);
- 	move_config(veid, DESTR);
- 	/* store root, private, ostemplate in case default used */
- 	if (cmd_p->res.fs.root_orig == NULL &&
-@@ -278,13 +282,42 @@
- 	return 0;
- }
- 
--int vps_postcreate(envid_t veid, fs_param *fs, tmpl_param *tmpl)
-+static char *long2str(unsigned long value, char *buf)
-+{
-+	int i;
-+	
-+	for (i = 0; i < 7; i++) {
-+	        int j = value % 64;
-+
-+		if (j < 1)
-+		        buf[i] = '.';
-+		else if (j == 1)
-+		        buf[i] = '/';
-+		else if (j < 12)
-+		        buf[i] = '0' - 2 + j;
-+		else if (j < 38)
-+		        buf[i] = 'A' - 12 + j;
-+		else if (j < 63)
-+		        buf[i] = 'a' - 38 + j;
-+		else
-+		        buf[i] = 'z';
-+
-+		buf[i+1] = '\0';
-+
-+		if (!(value /= 64))
-+		        break;
-+	}
-+
-+	return buf + i + 1;
-+}
-+
-+int vps_postcreate(envid_t veid, fs_param *fs, tmpl_param *tmpl, char *rootpw)
- {
- 	char buf[STR_SIZE];
- 	dist_actions actions;
- 	char *dist_name;
- 	char *arg[2];
--	char *env[3];
-+	char *env[5];
- 	int ret;
- 
- 	if (check_var(fs->root, "VE_ROOT is not set"))
-@@ -307,7 +340,30 @@
- 	snprintf(buf, sizeof(buf), "VE_ROOT=%s", fs->root);
- 	env[0] = buf;
- 	env[1] = ENV_PATH;
--	env[2] = NULL;
-+
-+	if (rootpw == NULL) {
-+	        env[2] = NULL;
-+	} else {
-+	        char ebuf1[STR_SIZE];
-+		char ebuf2[STR_SIZE];
-+		char salt[20];
-+		char *tmpsalt;
-+		char *cpassword = NULL;
-+		struct timeval tv;
-+
-+		salt[0] = salt[2] = '$'; salt[1] = '1';
-+		gettimeofday(&tv, (struct timezone *)0);
-+		tmpsalt = long2str(tv.tv_usec, &salt[3]);
-+		long2str(tv.tv_sec + getpid(), tmpsalt);
-+		cpassword = strdup(crypt(rootpw, salt));
-+
-+		snprintf(ebuf1, sizeof(ebuf1), "VE_ROOTPASSWD=%s", rootpw);
-+		env[2] = ebuf1;
-+		snprintf(ebuf2, sizeof(ebuf2), "VE_CROOTPASSWD=%s", cpassword);
-+		env[3] = ebuf2;
-+		env[4] = NULL;
-+	}
-+
- 	logger(0, 0, "Performing postcreate actions");
- 	ret = run_script(actions.post_create, arg, env, 0);
- 	fsumount(veid, fs->root);
---- vzctl-3.0.22/src/lib/config.c	2008-11-06 14:14:45.000000000 +0100
-+++ nvzctl-3.0.22/src/lib/config.c	2008-11-06 12:13:44.000000000 +0100
-@@ -195,6 +195,7 @@
- {"cpus",	required_argument, NULL, PARAM_VCPUS},
- /*      misc param     */
- {"initlog",	required_argument, NULL, PARAM_INITLOG},
-+{"rootpasswd",	required_argument, NULL, PARAM_ROOTPW},
- /*	create param	*/
- {"onboot",	required_argument, NULL, PARAM_ONBOOT},
- {"setmode",	required_argument, NULL, PARAM_SETMODE},
-@@ -1891,6 +1892,9 @@
- 	case PARAM_USERPW:
- 		ret = conf_parse_strlist(&vps_p->res.misc.userpw, val, 1);
- 		break;
-+	case PARAM_ROOTPW:
-+		ret = conf_parse_str(&vps_p->res.misc.rootpw, val, 1);
-+		break;
- 	case PARAM_APPLYCONFIG_MAP:
- 		if (!strcmp(val, "name"))
- 			vps_p->opt.apply_cfg_map = APPCONF_MAP_NAME;
---- vzctl-3.0.22/src/Makefile.am	2008-10-28 12:41:06.000000000 +0100
-+++ nvzctl-3.0.22/src/Makefile.am	2008-11-06 13:37:46.000000000 +0100
-@@ -34,7 +34,7 @@
-                 vzmemcheck \
-                 vzsplit
- 
--VZCTL_LIBS = $(top_builddir)/src/lib/libvzctl.la
-+VZCTL_LIBS = $(top_builddir)/src/lib/libvzctl.la -lcrypt
- 
- arpsend_SOURCES = arpsend.c
- 
---- vzctl-3.0.22/src/vzctl-actions.c	2008-10-28 12:41:06.000000000 +0100
-+++ nvzctl-3.0.22/src/vzctl-actions.c	2008-11-06 11:59:03.000000000 +0100
-@@ -200,6 +200,7 @@
- 	{"config",	required_argument, NULL, PARAM_CONFIG},
- 	{"private",	required_argument, NULL, PARAM_PRIVATE},
- 	{"root",	required_argument, NULL, PARAM_ROOT},
-+	{"rootpasswd",	required_argument, NULL, PARAM_ROOTPW},
- 	{"ipadd",	required_argument, NULL, PARAM_IP_ADD},
- 	{"hostname",	required_argument, NULL, PARAM_HOSTNAME},
- 	{"name",	required_argument, NULL, PARAM_NAME},
---- vzctl-3.0.22/include/create.h	2008-10-28 12:41:06.000000000 +0100
-+++ nvzctl-3.0.22/include/create.h	2008-11-06 12:42:27.000000000 +0100
-@@ -23,7 +23,7 @@
- 
- struct mod_action;
- 
--int vps_postcreate(envid_t veid, fs_param *fs, tmpl_param *tmpl);
-+int vps_postcreate(envid_t veid, fs_param *fs, tmpl_param *tmpl, char *rootpw);
- int vps_create(vps_handler *h, envid_t veid, vps_param *vps_p, vps_param *cmd_p,
- 	struct mod_action *action);
- int vps_destroy(vps_handler *h, envid_t veid, fs_param *fs);
---- vzctl-3.0.22/include/vzctl_param.h	2008-11-06 14:14:45.000000000 +0100
-+++ nvzctl-3.0.22/include/vzctl_param.h	2008-11-06 11:41:08.000000000 +0100
-@@ -134,7 +134,8 @@
- #define PARAM_NETIF_MAC_FILTER	360
- #define PARAM_NETIF_BRIDGE	361
- #define PARAM_DESCRIPTION	362
--#define PARAM_INITLOG		363
-+#define PARAM_ROOTPW		363
-+#define PARAM_INITLOG		364
- 
- #define PARAM_LINE		"e:p:f:t:i:l:k:a:b:n:x:h"
- #endif
---- vzctl-3.0.22/include/res.h	2008-11-06 14:14:45.000000000 +0100
-+++ nvzctl-3.0.22/include/res.h	2008-11-06 11:57:44.000000000 +0100
-@@ -50,6 +50,7 @@
- 	list_head_t userpw;
- 	list_head_t nameserver;
- 	list_head_t searchdomain;
-+	char *rootpw;
- 	char *hostname;
- 	char *description;
- 	int wait;

Deleted: vzctl/trunk/revert-vzgetnetdev-awk-fix.diff
===================================================================
--- vzctl/trunk/revert-vzgetnetdev-awk-fix.diff	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/revert-vzgetnetdev-awk-fix.diff	2010-08-06 09:56:06 UTC (rev 4939)
@@ -1,12 +0,0 @@
---- vzctl-3.0.23.org/scripts/vps-functions.in	2010-04-29 09:11:37.000000000 +0200
-+++ vzctl-3.0.23/scripts/vps-functions.in	2010-05-06 09:48:01.000000000 +0200
-@@ -100,8 +100,7 @@
- 	/^[0-9]+: / {
- 		dev="";
- 	}
--	/^[0-9]+: / && /\<UP\>/ && !/\<LOOPBACK\>/ \
--			&& !/\<SLAVE\>/ && !/\<NOARP\>/ {
-+	/^[0-9]+: / && /UP/ && !/LOOPBACK/ && !/SLAVE/ && !/NOARP/ {
- 		if ($2 !~ /^veth[0-9]+/)
- 			dev=$2;
- 	}

Deleted: vzctl/trunk/vzctl.diff
===================================================================
--- vzctl/trunk/vzctl.diff	2010-08-06 08:26:04 UTC (rev 4938)
+++ vzctl/trunk/vzctl.diff	2010-08-06 09:56:06 UTC (rev 4939)
@@ -1,216 +0,0 @@
---- vzctl-3.0.24.org/src/lib/env.c	2010-08-05 10:28:51.000000000 +0200
-+++ vzctl-3.0.24/src/lib/env.c	2010-08-05 10:28:51.000000000 +0200
-@@ -23,6 +23,7 @@
- #include <signal.h>
- #include <fcntl.h>
- #include <sys/types.h>
-+#include <sys/stat.h>
- #include <sys/wait.h>
- #include <string.h>
- #include <grp.h>
-@@ -280,7 +281,7 @@
- 	int fd, ret;
- 	vps_res *res;
- 	char *argv[] = {"init", "-z", "      ", NULL};
--	char *envp[] = {"HOME=/", "TERM=linux", NULL};
-+	char *envp[] = {"HOME=/", "TERM=linux", NULL, NULL};
- 
- 	res = (vps_res *) data;
- 	memset(&create_param, 0, sizeof(create_param));
-@@ -382,12 +383,65 @@
- 	*/
- 	if (read(wait_p, &ret, sizeof(ret)) != 0)
- 		return 0;
--	if ((fd = open("/dev/null", O_RDWR)) != -1) {
--		dup2(fd, 0);
--		dup2(fd, 1);
--		dup2(fd, 2);
--	}
-+
- 	logger(10, 0, "Starting init");
-+
-+	if (((fd = open("/dev/null", O_RDWR)) != -1) && (fd == STDIN_FILENO)) {
-+
-+		dup2(fd, 1); // STDOUT = /dev/null
-+		dup2(fd, 2); // STDERR = /dev/null
-+	  
-+		if (res->misc.initlog == 1) {
-+		        int pid;
-+
-+			if (!((mkfifo ("/var/log/init.fifo", 0600) == 0) || (errno == EEXIST))) {
-+			        logger(-1, errno, "unable to create init fifo");
-+				return 0;
-+			}
-+
-+			// create new /dev/console ==> /var/log/init.fifo
-+			unlink ("/dev/console");
-+			symlink ("/var/log/init.fifo", "/dev/console");
-+
-+			pid = fork();
-+
-+			if (pid == -1) {
-+			        logger(-1, errno, "unable to fork init-logger");
-+				return 0;
-+			}
-+
-+			if (!pid) {
-+		    
-+			        close(wait_p); close(err_p);
-+
-+				/* Note: open fifo RDWR to avoid EOF */
-+				close(STDIN_FILENO);
-+				open("/var/log/init.fifo", O_RDWR);
-+
-+				close(STDOUT_FILENO); 
-+				open("/var/log/init.log", O_CREAT|O_WRONLY|O_TRUNC);
-+				
-+				close(STDERR_FILENO); 
-+				dup2(STDOUT_FILENO, STDERR_FILENO);
-+
-+				execl("/sbin/init-logger", NULL);
-+				exit (-1);
-+			}
-+
-+			close(STDOUT_FILENO); 
-+			if (open("/var/log/init.fifo", O_WRONLY) == -1) {
-+			        logger(-1, errno, "open init.fifo failed");
-+				return 0;
-+			}
-+
-+			close(STDERR_FILENO); 
-+			dup2(STDOUT_FILENO, STDERR_FILENO);
-+
-+			// tell init to use /var/log/init.fifo
-+			envp[2] = "CONSOLE=/var/log/init.fifo";
-+		}
-+	}
-+
- 	execve("/sbin/init", argv, envp);
- 	execve("/etc/init", argv, envp);
- 	execve("/bin/init", argv, envp);
-@@ -403,6 +457,20 @@
- {
- 	int ret, pid;
- 
-+        char ildest[4096];
-+
-+        *ildest = 0;
-+        strcat (ildest, res->fs.root);
-+        strcat (ildest, "/sbin/init");
-+
-+        *ildest = 0;
-+        strcat (ildest, res->fs.root);
-+        strcat (ildest, "/sbin/init-logger");
-+        if (cp_file (ildest, "/usr/lib/vzctl/scripts/init-logger") != 0) {
-+                logger(-1, 0, "Unable to copy init-logger");
-+                return VZ_RESOURCE_ERROR;
-+        }
-+
- 	if ((ret = vz_chroot(res->fs.root)))
- 		return ret;
- 	if ((ret = vz_setluid(veid)))
---- vzctl-3.0.24.org/src/lib/config.c	2010-08-05 10:28:51.000000000 +0200
-+++ vzctl-3.0.24/src/lib/config.c	2010-08-05 10:33:49.000000000 +0200
-@@ -60,6 +60,7 @@
- {"LOG_LEVEL",	NULL, PARAM_LOGLEVEL},
- {"LOGFILE",	NULL, PARAM_LOGFILE},
- {"VERBOSE",	NULL, PARAM_VERBOSE},
-+{"INITLOG",	NULL, PARAM_INITLOG},
- 
- {"IPTABLES",	NULL, PARAM_IPTABLES},
- /*	UB	*/
-@@ -116,6 +117,8 @@
- {"CPUUWEIGHT",	NULL, PARAM_CPUWEIGHT},
- {"CPULIMIT",	NULL, PARAM_CPULIMIT},
- {"CPUS",	NULL, PARAM_VCPUS},
-+/*      misc param     */
-+{"INITLOG",	NULL, PARAM_INITLOG},
- /* create param	*/
- {"ONBOOT",	NULL, PARAM_ONBOOT},
- {"CONFIGFILE",	NULL, PARAM_CONFIG},
-@@ -1104,6 +1107,9 @@
- 
- 	ret = 0;
- 	switch (conf->id) {
-+	case PARAM_INITLOG:
-+		ret = conf_store_yesno(conf_h, conf->name, misc->initlog);
-+		break;
- 	case PARAM_ONBOOT:
- 		ret = conf_store_yesno(conf_h, conf->name, misc->onboot);
- 		break;
-@@ -1704,6 +1710,9 @@
- 	case PARAM_LOGGING:
- 		ret = conf_parse_yesno(&vps_p->log.enable, val);
- 		break;
-+	case PARAM_INITLOG:
-+		ret = conf_parse_yesno(&vps_p->res.misc.initlog, val);
-+		break;
- 	case PARAM_LOGLEVEL:
- 		if (parse_int(val, &int_id))
- 			break;
-@@ -2502,6 +2511,7 @@
- 	MERGE_INT(onboot)
- 	MERGE_P(bootorder)
- 	MERGE_INT(wait)
-+	MERGE_INT(initlog)
- }
- 
- static void merge_dq(dq_param *dst, dq_param *src)
---- vzctl-3.0.24.org/scripts/Makefile.am	2010-08-05 10:28:51.000000000 +0200
-+++ vzctl-3.0.24/scripts/Makefile.am	2010-08-05 10:28:51.000000000 +0200
-@@ -18,6 +18,7 @@
- include $(top_srcdir)/pathsubst.am
- 
- vzlib_SCRIPTS = \
-+        init-logger \
- 	vps-create \
- 	vps-functions \
- 	vps-net_add \
---- vzctl-3.0.24.org/etc/vz.conf	2010-08-05 10:28:51.000000000 +0200
-+++ vzctl-3.0.24/etc/vz.conf	2010-08-05 10:28:51.000000000 +0200
-@@ -10,6 +10,9 @@
- LOG_LEVEL=0
- VERBOSE=0
- 
-+## log output of init process to $VE_ROOT/var/log/init.log
-+INITLOG=yes
-+
- ## Disk quota parameters
- DISK_QUOTA=yes
- VZFASTBOOT=no
---- vzctl-3.0.24.org/include/res.h	2010-08-05 10:28:51.000000000 +0200
-+++ vzctl-3.0.24/include/res.h	2010-08-05 10:28:51.000000000 +0200
-@@ -55,6 +55,7 @@
- 	int onboot;
- 	unsigned long *bootorder;
- 	int wait;
-+	int initlog;
- } misc_param;
- 
- struct mod_action;
---- vzctl-3.0.24.org/include/vzctl_param.h	2010-08-05 10:28:51.000000000 +0200
-+++ vzctl-3.0.24/include/vzctl_param.h	2010-08-05 10:28:51.000000000 +0200
-@@ -132,6 +132,7 @@
- #define PARAM_DESCRIPTION	362
- #define PARAM_SWAPPAGES		363
- #define PARAM_BOOTORDER		364
-+#define PARAM_INITLOG		365
- 
- #define PARAM_LINE		"e:p:f:t:i:l:k:a:b:n:x:h"
- #endif
---- vzctl-3.0.24.org/man/ctid.conf.5	2010-08-05 10:28:51.000000000 +0200
-+++ vzctl-3.0.24/man/ctid.conf.5	2010-08-05 10:28:51.000000000 +0200
-@@ -28,6 +28,13 @@
- Default is \fBno\fR, meaning the container will not be started
- if \fBONBOOT\fR parameter is omitted.
- Corresponds to the \fB--onboot\fR option.
-+.IP \fBINITLOG\fR="\fByes\fR|\fBno\fR"
-+If enabled init output is logged to /var/log/init.log. This is done by
-+opening a BSD pseudo terminal device. A new /dev/console is created and points
-+to that pseudo terminal slave. An additional process started 
-+inside the container (init-logger) reads the master and write results 
-+to /var/log/init.log.
-+Corresponds to the \fB--initlog\fR option.
- .IP \fBBOOTORDER\fR="\fInumber\fR"
- Specifies the CT boot order priority. Corresponds to the
- \fB--bootorder\fR option.




More information about the pve-devel mailing list