added chcontext wrapper
[util-vserver.git] / util-vserver / scripts / functions
index 827910a..4002642 100644 (file)
@@ -102,7 +102,7 @@ function _pkgSetVarsBase
            }
            
            VDIR=$BASEDIR/vdir
-           test -d "$VDIR"   || VDIR=/vservers/$vserver
+           test -d "$VDIR"   || VDIR=$DEFAULT_VSERVERDIR/$vserver
            VDIR=$(getPhysicalDir "$VDIR")
            
            PKGDIR=$BASEDIR/apps/pkgmgmt
@@ -176,8 +176,9 @@ function _pkgMountRPM
 
     "$_SECURE_MOUNT" --chroot "$VDIR" -n --secure --bind "$RPMSTATEDIR" "$_rpmdb_mntpoint"
     test -z "$WORKAROUND_106057" || mount -n --bind "$RPMSTATEDIR" "$_rpmdb_mntpoint"
-    
-    "$_SECURE_MOUNT" --chroot "$VDIR" -n --secure -t proc none /proc
+
+    test -e "$VDIR"/proc/self/status || \
+       "$_SECURE_MOUNT" --chroot "$VDIR" -n --secure -t proc none /proc
 }
 
 function _pkgSetEnvBase