From 720d7e009dd68fd52d1817e3a645566ef9d99a65 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Wed, 11 Feb 2004 23:39:06 +0000 Subject: [PATCH] made namespace stuff configurable at a global place git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@879 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/scripts/vserver.functions | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/util-vserver/scripts/vserver.functions b/util-vserver/scripts/vserver.functions index 94f59e4..a86303a 100644 --- a/util-vserver/scripts/vserver.functions +++ b/util-vserver/scripts/vserver.functions @@ -436,6 +436,13 @@ function generateOptions _generateChcontextOptions "$1" } +function _isAvoidNamespace +{ + test ! -e "$1"/namespace || return 1 + test -e "$CONFDIR"/.defaults/nonamespace -o \ + -e "$1"/nonamespace +} + function mountVserver { local cfgdir=$1 @@ -455,7 +462,7 @@ function mountVserver $_CHBIND "${CHBIND_OPTS[@]}" \ $_SECURE_MOUNT -a --chroot "$vdir" --fstab "$cfgdir"/fstab - test -e "$cfgdir"/nonamespace || \ + _isAvoidNamespace "$cfgdir" || \ $_SECURE_MOUNT --rbind -n "$vdir" "/" } @@ -466,9 +473,9 @@ function umountVserver is_ok=1 - test -e "$cfgdir"/nonamespace || return 0 - test -e "$cfgdir"/fstab || return 0 - test "$_HAVE_CHBIND_OPTIONS" || _generateChbindOptions "$cfgdir" + _isAvoidNamespace "$cfgdir" || return 0 + test -e "$cfgdir"/fstab || return 0 + test "$_HAVE_CHBIND_OPTIONS" || _generateChbindOptions "$cfgdir" pushd "$vdir/" >/dev/null tac "$cfgdir"/fstab | while read src dst tmp; do -- 1.8.1.5