This file is indexed.

/usr/lib/util-vserver/vserver.start is in util-vserver 0.30.216-pre2864-2ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# $Id: vserver.start 2819 2008-10-31 15:41:04Z dhozac $  --*- sh -*--

# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#  
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#  
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#  
# You should have received a copy of the GNU General Public License
# 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."$($_VSERVER_INFO "$VSERVER_DIR" CANONIFY)".startup

if isVserverRunning "$VSERVER_DIR"; then
    warning $"vserver '$VSERVER_NAME' already running"
    exit 0
fi

function cleanup()
{
    set +e

    test -z "$startsync_pipe"  || $_RM -f "$startsync_pipe"
    test -z "$is_started"      || { unlock; return 0; }

    if test -n "$is_configured" -a -z "$is_executed"; then
	warning $"
An error occured while executing the vserver startup sequence; when
there are no other messages, it is very likely that the init-script
(${INITCMD_START[@]}) failed.

Common causes are:
* /etc/rc.d/rc on Fedora Core 1 and RH9 fails always; the 'apt-rpm' build
  method knows how to deal with this, but on existing installations,
  appending 'true' to this file will help."
    fi

    if test -n "$is_executed"; then
	warning $"
An error occured after executing the vserver startup sequence. This
means that some processes may exist in the created context and the
manual execution of

  $_VSERVER '$VSERVER_DIR' stop

is recommended to fix this."
    else
	warning $"

Failed to start vserver '$VSERVER_NAME'"
    fi

    test -n "$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=
is_executed=
is_started=
is_mounted=
is_vshelper_init=
have_interfaces=
startsync_pipe=
have_initcmd=

while test "$#" -gt 0; do
    case "$1" in
	(--rescue)	INITSTYLE=rescue;;
	(--rescue-cmd)
	    warning $"\
The '--rescue-cmd' option is deprecated; just add the the initcmd
inclusive its arguments to the cmdline."
	    INITCMD_RESCUE=( $2 );
	    have_initcmd=1
	    shift;;
	(--rescue-init)	_IS_FAKEINIT=1;;
	(--)		shift; break;;
	(-*)		panic $"vserver ... start: unknown option '$1'";;
	(*)		break;
    esac
    shift
done

if test x"$INITSTYLE" = xrescue -a -z "$have_initcmd" -a "$#" -gt 0; then
    INITCMD_RESCUE=( "$@" )
fi


set -e
trap "cleanup" EXIT

sanityCheck      "$VSERVER_DIR"

pushd "$VSERVER_DIR" >/dev/null
execScriptlets   "$VSERVER_DIR" "$VSERVER_NAME" initialize
popd >/dev/null

fsckAllFS        "$VSERVER_DIR"

mountRootFS      "$VSERVER_DIR"
generateOptions  "$VSERVER_DIR"

pushd "$VSERVER_DIR" >/dev/null
execScriptlets   "$VSERVER_DIR" "$VSERVER_NAME" prepre-start
popd >/dev/null

setDiskLimits    "$VSERVER_DIR"

enableInterfaces "$VSERVER_DIR" && have_interfaces=1

mountVserver     "$VSERVER_DIR" && is_mounted=1
prepareInit      "$VSERVER_DIR"
addtoCPUSET      "$VSERVER_DIR"
attachToCgroup   "$VSERVER_DIR"

handleDeviceMap --set "$S_CONTEXT" "$VSERVER_DIR/apps/vdevmap"

pushd "$VSERVER_DIR"/vdir/ >/dev/null
execScriptlets   "$VSERVER_DIR" "$VSERVER_NAME" pre-start
popd >/dev/null

test -z "$OPTION_DEFAULTTTY" || setDefaultTTY "$VSERVER_DIR"

pushd "$VSERVER_DIR"/vdir/ >/dev/null
is_configured=1
if $_VSERVER_INFO - FEATURE migrate; then
    ${IONICE_CMD[@]} \
    ${NICE_CMD[@]} \
    "${CHBIND_CMD[@]}" \
    $_EXEC_ULIMIT "$VSERVER_DIR"/ulimits \
    $_VTAG       --create "${OPTS_VTAG_CREATE[@]}" --silent -- \
    $_VSPACE     --new "${OPTS_VSPACE[@]}" -- \
    $_VCONTEXT   --create "${OPTS_VCONTEXT_CREATE[@]}" -- \
    ${OPTION_STRACE:+$_STRACE -fF -o /tmp/vserver-start.$$} \
    ${USE_VNAMESPACE:+$_VNAMESPACE --set -- } \
    $_VSPACE     --set "${OPTS_VSPACE[@]}" -- \
    $_EXEC_REMOUNT /proc /sys -- \
    $_VLIMIT     --dir "$VSERVER_DIR"/rlimits --missingok -- \
    $_VSCHED     --xid self --force "${OPTS_VSCHED[@]}" -- \
    $_VSYSCTL    --xid self --dir "$VSERVER_DIR"/sysctl --missingok -- \
    $_VUNAME     --xid self --dir "$VSERVER_DIR"/uts    --missingok -- \
    $_VMEMCTRL   --xid self --set "${OPTS_VMEMCTRL[@]}" -- \
    "${VSERVER_EXTRA_CMDS[@]}" \
    $_VUNAME     --xid self --set -t context="$VSERVER_DIR" -- \
    $_VATTRIBUTE --set "${OPTS_VATTRIBUTE[@]}" -- \
    $_SAVE_CTXINFO "$VSERVER_DIR" \
    $_ENV -i "${OPTS_ENV[@]}" \
    $_VCONTEXT   --migrate-self --endsetup $OPT_VCONTEXT_CHROOT $SILENT_OPT \
    "${OPTS_VCONTEXT_MIGRATE[@]}" "${OPTS_VCONTEXT_ENTER[@]}" -- \
    "${INITCMD_START[@]}"
else
    if test -n "$_IS_FAKEINIT"; then
	startsync_pipe=$($_MKTEMP vserver-start.XXXXXX)
	$_RM -f "$startsync_pipe"
	$_MKFIFO -m600 "$startsync_pipe"	## safe, since mkfifo does not follow symlinks
    fi
    
    ${IONICE_CMD[@]} \
    ${NICE_CMD[@]} \
    "${CHBIND_CMD[@]}" \
    $_EXEC_ULIMIT      "$VSERVER_DIR/ulimits" \
    $_CHCONTEXT_COMPAT "${CHCONTEXT_OPTS[@]}" "${CHCONTEXT_INIT_OPTS[@]}" \
    $_SAVE_CTXINFO     "$VSERVER_DIR" \
    $_ENV -i "${OPTS_ENV[@]}" \
    $_CHAINECHO "${_IS_FAKEINIT:+$startsync_pipe}" "" \
    $_CAPCHROOT        "${CAPCHROOT_OPTS[@]}" . \
    "${INITCMD_START[@]}"

    ## the additional synchronization step is needed since vshelper.doInit
    ## below might be executed before needed context information were
    ## saved by $_SAVE_CTXINFO
    ${_IS_FAKEINIT:+cat "$startsync_pipe"} >/dev/null
fi
is_executed=1

"${INITCMD_START_SYNC[@]}"
popd >/dev/null

pushd "$VSERVER_DIR"/vdir/ >/dev/null
execScriptlets   "$VSERVER_DIR" "$VSERVER_NAME" post-start
popd >/dev/null

is_vshelper_init=1
! vshelper.isEnabled "" "$VSERVER_DIR" || vshelper.doInit "$VSERVER_DIR"

is_started=1