declare -a OPTS_VCONTEXT_CREATE=()
declare -a OPTS_VCONTEXT_MIGRATE=()
declare -a OPTS_VCONTEXT_ENTER=()
+OPT_VCONTEXT_CHROOT=--chroot
declare -a OPTS_VATTRIBUTE=( --flag fakeinit )
declare -a OPTS_VSCHED=()
declare -a OPTS_ENV=()
local ionice_class=2
local ionice_priority=0
+ test -n "$_IONICE" || return 0
+
test -r "$vdir/ionice/class" && read ionice_class <"$vdir"/ionice/class
test -r "$vdir/ionice/priority" && read ionice_priority <"$vdir"/ionice/priority
isAvoidNamespace "$vdir" || {
USE_VNAMESPACE=1
CHCONTEXT_FLAG_OPTS=( "${CHCONTEXT_FLAG_OPTS[@]}" --flag namespace )
+ ! $_VSERVER_INFO - FEATURE PIVOT_ROOT || \
+ OPT_VCONTEXT_CHROOT=--pivot-root
}
}
# magic regarding the mtab file; when etc/mtab can not be touched,
# add the '-n' flag to mount
test -w etc -o -w etc/mtab || xflag=-n
+ if test -h etc/mtab; then
+ local l=$($_READLINK etc/mtab)
+ test "${l##/proc/}" = "$l" || xflag=-n
+ fi
"$@" $_SECURE_MOUNT -a $xflag --chroot --fstab "$fstab" --rootfs no
popd >/dev/null
}
local ns_opt=$2
local vdir=$1/vdir
local mtab_src
+ local extra_opt=
+ local real_vdir
test -e "$cfgdir"/fstab -o \
-e "$cfgdir"/fstab.local -o \
isNamespaceCleanup "$cfgdir" && \
_namespaceCleanup "$cfgdir"
+ real_vdir=$(getPhysicalDir "$vdir")
isAvoidNamespace "$cfgdir" || \
- $_SECURE_MOUNT --rbind -n -o dev "$vdir" "/"
+ $_SECURE_MOUNT --rbind -n -o dev "$vdir" "$real_vdir"
+ ! $_VSERVER_INFO - FEATURE PIVOT_ROOT || \
+ $_SECURE_MOUNT -n -o shared,rec "$real_vdir" "$real_vdir"
}
function _umountVserverInternal
while read -r dev path opts; do
test -n "$path" || continue
for i in "$root" /dev /proc; do
- test "${path#$i}" != "$path" && continue 2
+ path_dir="${path}/"
+ test "${path_dir#${i}/}" != "${path_dir}" && continue 2
done
for i in "${list[@]}" /; do
test "$path" = "$i" && continue 2
findFile file "$__CONFDIR/.defaults/cgroup/subsys" ""
if test -n "$file"; then
read CGROUP_SUBSYS < "$file"
+ elif $_GREP -q '^ns[[:space:]]' /proc/cgroups; then
+ # Hack for the ns subsystem, with which we are incompatible
+ CGROUP_SUBSYS=$($_SED '/^#/d;/^ns[[:space:]]/d;s/[[:space:]].*//' /proc/cgroups | \
+ (s=""; while read x; do test -n "$s" && s="$s,"; s="$s$x"; done; echo "$s"))
fi
findFile file "$__CONFDIR/.defaults/cgroup/inherit" ""
if test -n "$file"; then
shopt -s nullglob
for i in "$dir"/*; do
- cat "$i" > "$CGROUP_MNT/$name/${i##*/}"
+ f="${i##*/}"
+ test "$f" != mnt -a "$f" != subsys -a \
+ "$f" != inherit -a "$f" != name || continue
+ cat "$i" > "$CGROUP_MNT/$name/$f"
done
fi
echo "$$" > "$CGROUP_MNT/$name/tasks"