[projects/rc-scripts/lxc: 2/2] make lxc behave same as vserver

glen glen at pld-linux.org
Mon Nov 18 22:17:45 CET 2013


commit 8fe77b08c7a6317d91a4396585fc5cd637a020d3
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Nov 18 23:16:50 2013 +0200

    make lxc behave same as vserver
    
    this probably deserves config variable for cases where people do want to
    mount or configure network inside container

 rc.d/init.d/netfs | 2 +-
 rc.d/rc.sysinit   | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/rc.d/init.d/netfs b/rc.d/init.d/netfs
index 0552d33..ef869e0 100755
--- a/rc.d/init.d/netfs
+++ b/rc.d/init.d/netfs
@@ -15,7 +15,7 @@
 . /etc/rc.d/init.d/cryptsetup
 . /etc/sysconfig/network
 
-if is_yes "$VSERVER"; then
+if is_yes "$VSERVER" || [[ "$container" = lxc* ]]; then
 	exit 0
 fi
 
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 1b81dce..ee8041c 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -354,7 +354,7 @@ else
 	RC_BOOTLOG=
 fi
 
-if ! is_yes "$VSERVER"; then
+if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then
 	# we need /proc mounted before everything
 	is_fsmounted proc /proc || mount -n /proc || mount -n -o gid=17,hidepid=2 -t proc /proc /proc
 
@@ -428,7 +428,7 @@ else
 	domainname ""
 fi
 
-if ! is_yes "$VSERVER"; then
+if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then
 	# Set console loglevel
 	if [ -n "$CONSOLE_LOGLEVEL" ]; then
 		dmesg -n $CONSOLE_LOGLEVEL
@@ -502,7 +502,7 @@ if ! is_yes "$VSERVER"; then
 		fi
 	fi
 
-	if [ "$usb" = "1" -a -d /proc/bus/usb ] && ! is_fsmounted usbfs /proc/bus/usb ; then
+	if [ "$usb" = "1" -a -d /proc/bus/usb ] && ! is_fsmounted usbfs /proc/bus/usb; then
 		run_cmd "Mounting USB filesystem" mount -n -t usbfs -o devgid=78,devmode=664 usbfs /proc/bus/usb
 	fi
 
@@ -621,7 +621,7 @@ if [ -n "$IN_INITLOG" ]; then
 	IN_INITLOG=""
 fi
 
-if ! is_yes "$VSERVER"; then
+if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then
 	# Clear mtab
 	> /etc/mtab
 	[ -f /etc/cryptomtab ] && > /etc/cryptomtab
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/rc-scripts.git/commitdiff/8fe77b08c7a6317d91a4396585fc5cd637a020d3



More information about the pld-cvs-commit mailing list