# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+lock "$LOCKDIR"/vserver."$(echo "$VSERVER_DIR" | tr -dc a-zA-Z0-9)".startup
+
if isVserverRunning "$VSERVER_DIR"; then
echo $"vserver '$VSERVER_NAME' already running; aborting..." >&2
exit 1
function cleanup()
{
+ set +e
+
test -z "$startsync_pipe" || rm -f "$startsync_pipe"
- test -z "$is_started" || return 0
+ test -z "$is_started" || { unlock; return 0; }
if test "$is_configured" -a -z "$is_executed"; then
warning $"
test "$OPTION_DEBUG" || exec 2>/dev/null >/dev/null
test -z "$is_mounted" || umountVserver "$VSERVER_DIR" || :
test -z "$have_interfaces" || disableInterfaces "$VSERVER_DIR" || :
+
+ unlock || :
}
is_configured=
execScriptlets "$VSERVER_DIR" "$VSERVER_NAME" pre-start
popd >/dev/null
-test -z "$OPTION_DEFAULTTTY" || setDefaultTTY
+test -z "$OPTION_DEFAULTTTY" || setDefaultTTY "$VSERVER_DIR"
pushd "$VSERVER_DIR"/vdir/ >/dev/null
is_configured=1
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+lock "$LOCKDIR"/vserver."$(echo "$VSERVER_DIR" | tr -dc a-zA-Z0-9)".startup
+
if ! isVserverRunning "$VSERVER_DIR" S_CONTEXT; then
echo $"vserver '$VSERVER_NAME' is not running; aborting..." >&2
test "$OPTION_DEBUG" || exec 2>/dev/null >/dev/null
umountVserver "$VSERVER_DIR" || :
disableInterfaces "$VSERVER_DIR" || :
+ unlock
exit 1
fi
function cleanup
{
+ set +e
+ unlock
+
test ! -p "$sync_fifo" || {
rm -f "$sync_fifo"
rmdir $(dirname "$sync_fifo")
execScriptlets "$VSERVER_DIR" "$VSERVER_NAME" pre-stop
cd "$VSERVER_DIR"/vdir/
-test -z "$OPTION_DEFAULTTTY" || setDefaultTTY
+test -z "$OPTION_DEFAULTTTY" || setDefaultTTY "$VSERVER_DIR"
fail=
if test "$_IS_FAKEINIT" && \