X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fscripts%2Fvserver.functions;h=9db6007d88ebb5d0e1edd3eeb1adacc57ac00711;hb=66ff8eb2e4f7e51fab7bf0eae4a756c9f54b7132;hp=a9159f4471bc84a98b32bb44d6f81b0ef94a213d;hpb=d81a21a5aeabeb306de7fd305e15fa37f7a55c6d;p=util-vserver.git diff --git a/util-vserver/scripts/vserver.functions b/util-vserver/scripts/vserver.functions index a9159f4..9db6007 100644 --- a/util-vserver/scripts/vserver.functions +++ b/util-vserver/scripts/vserver.functions @@ -228,6 +228,7 @@ function _generateFlagOptions while read flag; do case x"$flag" in x|x#) ;; + xnamespace) ;; xfakeinit) CHCONTEXT_INIT_OPTS=( --disconnect --flag fakeinit ) ;; @@ -237,6 +238,9 @@ function _generateFlagOptions ;; esac done <"$vdir"/flags + + isAvoidNamespace "$cfgdir" || \ + CHCONTEXT_FLAG_OPTS=( "${CHCONTEXT_FLAG_OPTS[@]}" --flag namespace ) } function _generateChcontextOptions @@ -323,7 +327,7 @@ function _processSingleInterface _getInterfaceValue name '' "$iface" _getInterfaceValue scope '' "$iface" "$iface/.." - test "$ip" || { echo $"Can not read ip for '$iface'"; return 1; } + test "$ip" || { echo $"Can not read ip for '$iface'" >&2; return 1; } test ! -e "$iface"/only_ip || unset dev @@ -333,7 +337,7 @@ function _processSingleInterface case "$dev" in *.*) test -d /proc/net/vlan || { - echo -e $"VLAN device-name used, but vlan subsystem not enabled.\nTry to execute 'modprobe 8021q' before starting the vservers" + echo -e $"VLAN device-name used, but vlan subsystem not enabled.\nTry to execute 'modprobe 8021q' before starting the vservers" >&2 return 1 } test -f /proc/net/vlan || { @@ -439,6 +443,7 @@ function generateOptions function mountVserver { local cfgdir=$1 + local ns_opt=$2 local vdir=$1/vdir local mtab_src @@ -453,6 +458,9 @@ function mountVserver test "$_HAVE_CHBIND_OPTIONS" || _generateChbindOptions "$cfgdir" $_CHBIND "${CHBIND_OPTS[@]}" \ $_SECURE_MOUNT -a --chroot "$vdir" --fstab "$cfgdir"/fstab + + isAvoidNamespace "$cfgdir" || \ + $_SECURE_MOUNT --rbind -n "$vdir" "/" } function umountVserver @@ -462,7 +470,8 @@ function umountVserver is_ok=1 - test -e "$cfgdir"/fstab || return 0 + isAvoidNamespace "$cfgdir" || return 0 + test -e "$cfgdir"/fstab || return 0 test "$_HAVE_CHBIND_OPTIONS" || _generateChbindOptions "$cfgdir" pushd "$vdir/" >/dev/null