git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2418
94cd875c-1c1d-0410-91d2-
eb244daf1a30
_VS_LOCKS="$@"
}
+function get_init_cwd
+{
+ if test -n "$INIT_CWD"; then
+ echo "$INIT_CWD"
+ else
+ pwd
+ fi
+}
+function set_init_cwd
+{
+ INIT_CWD="`pwd`"
+ export INIT_CWD
+}
+
function _getVserverDir
{
local vserver="$1"
case "$vserver" in
- ./*) VSERVER_DIR=`pwd`/$vserver ;;
- /*) VSERVER_DIR=$vserver ;;
- *) VSERVER_DIR=$__CONFDIR/$vserver;;
+ ./*) VSERVER_DIR="`get_init_cwd`/$vserver";;
+ /*) VSERVER_DIR="$vserver" ;;
+ *) VSERVER_DIR="$__CONFDIR/$vserver" ;;
esac
}
! isVserverRunning "$VSERVER_DIR" || \
exec $_VNAMESPACE --enter "$VSERVER_DIR" -- $_VSERVER ----nonamespace "${OPTIONS_ORIG[@]}"
+set_init_cwd
+cd /
+
. $__PKGLIBDIR/vserver.functions
case "$2" in
(start|stop|delete)
# these are things that have to be accessible post-cleanup
for tmp in "$root" "$__SBINDIR" "$__PKGLIBDIR" "$vdir" \
- "$__PKGSTATEDIR" "`pwd`" "${skip[@]}"; do
+ "$__PKGSTATEDIR" "${skip[@]}"; do
while test -n "$tmp"; do
list=( "${list[@]}" "$tmp" )
tmp="${tmp%/*}"