# $VSERVER_NAME ... name of vserver
declare -a NICE_CMD=()
+declare -a IONICE_CMD=()
declare -a CHBIND_CMD=()
declare -a CAP_OPTS=()
declare -a CHCONTEXT_INIT_OPTS=()
NICE_CMD=( $_NICE -n $nice )
}
+function _generateIONiceCommand
+{
+ local vdir=$1
+ local ionice_class=2
+ local ionice_priority=0
+
+ test -r "$vdir/ionice/class" && read ionice_class <"$vdir"/ionice/class
+ test -r "$vdir/ionice/priority" && read ionice_priority <"$vdir"/ionice/priority
+
+ IONICE_CMD=( $_IONICE -c$ionice_class -n$ionice_priority )
+}
function _generatePersonalityOptions
{
test -n "$RUNLEVEL_START" || RUNLEVEL_START="default"
RC_PATH=/usr/sbin:/usr/bin:/sbin:/bin
- INITCMD_START=( env TERM=$TERM /lib/rcscripts/sh/init-vserver.sh "$RUNLEVEL_START" )
+ if test -x "$vdir/vdir/lib/rcscripts/sh/init-vserver.sh"; then
+ RC_WRAP=/lib/rcscripts/sh/init-vserver.sh
+ elif test -x "$vdir/vdir/lib/rc/sh/init-vserver.sh"; then
+ RC_WRAP=/lib/rc/sh/init-vserver.sh
+ else
+ panic "init-vserver.sh not found; aborting"
+ fi
+
+ INITCMD_START=( env TERM=$TERM $RC_WRAP "$RUNLEVEL_START" )
INITCMD_STOP=( env -i PATH=$RC_PATH TERM=$TERM RUNLEVEL=0 /sbin/rc shutdown )
INITCMD_PREPARE=( $_FAKE_RUNLEVEL 3 /var/run/utmp )
;;
local mac
local extip
local up="up"
+ local peer
_getInterfaceValue ip '' "$iface"
_getInterfaceValue extip '' "$iface" "$iface/.."
_getInterfaceValue name '' "$iface"
_getInterfaceValue scope '' "$iface" "$iface/.."
_getInterfaceValue mac '' "$iface"
+ _getInterfaceValue peer '' "$iface"
test -n "$ip" || { echo $"Can not read ip for '$iface'" >&2; return 1; }
test -n "$dev" -o -e "$iface"/nodev || {
_addInterfaceCmd TUNCTL "$dev" $tun_info
fi
- _addInterfaceCmd IP_ADDR "$ip${prefix:+/$prefix}" $use_bcast ${name:+label "$dev:$name"} dev "$dev"
+ _addInterfaceCmd IP_ADDR "$ip${prefix:+/$prefix}" $use_bcast ${name:+label "$dev:$name"} dev "$dev" ${peer:+peer "$peer"}
#_addInterfaceCmd IP_ROUTE "$ip${prefix:+/$prefix}" dev "$dev"
_addInterfaceCmd IP_LINK "$dev" $up
elif ! test -n "$N_CONTEXT"; then
local vdir="$1"
local d="$vdir"/spaces
- test ! -e "$d"/pid || \
- OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --pid )
+ ( test ! -e "$d"/pid &&
+ ! $_VSERVER_INFO PIDSPACE FEATURE ) || \
+ OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --pid )
test ! -e "$d"/net || {
OPTS_VSPACE=( "${OPTS_VSPACE[@]}" --net )
_generateInterfaceOptions "$1"
test -n "$_HAVE_CHBIND_OPTIONS" || _generateChbindOptions "$1"
_generateNiceCommand "$1"
+ _generateIONiceCommand "$1"
_generateInitOptions "$1"
_generateChcontextOptions "$1"
_generateScheduleOptions "$1"
done < /proc/mounts
# separate loop to avoid races while reading /proc/mounts
for i in "${list_umount[@]}"; do
- $_UMOUNT -l -n "$i"
+ $_UMOUNT -l -n -i "$i"
done
}