Skip to content
Snippets Groups Projects
Commit ec6dc4ea authored by Simon McVittie's avatar Simon McVittie
Browse files

_start-container-in-background: Don't repeatedly start container


If starting the container failed the first time we tried it, there's
no point in trying again repeatedly. Unfortunately, when Steam runs
setup commands, it ignores their exit status, so we can't make it
give up early.

Because the main game runs in a slightly different environment, it's
possible that it might succeed even when setup commands fail, and it's
also possible that launch options are making it more verbose or
debuggable, so try harder to start that one.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 65732ec1
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ me="${me##*/}"
# Don't rely on it.
deploy=
force=
rendezvous=
suite=scout
verbose=
......@@ -44,6 +45,7 @@ usage () {
echo
echo "Options"
echo "--deploy=DIR Deploy to this directory [default=SUITE]."
echo "--force Try even if an earlier attempt failed."
echo "--session=PATH Directory representing a session."
echo "--suite=SUITE Run in this runtime [default=scout]."
echo "--verbose Be more verbose."
......@@ -53,6 +55,7 @@ usage () {
getopt_temp="help"
getopt_temp="${getopt_temp},deploy:"
getopt_temp="${getopt_temp},force"
getopt_temp="${getopt_temp},session:"
getopt_temp="${getopt_temp},suite:"
getopt_temp="${getopt_temp},verbose"
......@@ -73,6 +76,11 @@ while [ "$#" -gt 0 ]; do
shift 2
;;
(--force)
force=yes
shift
;;
(--session)
rendezvous="$2"
shift 2
......@@ -122,6 +130,12 @@ if [ -S "$rendezvous/socket" ]; then
exit 0
fi
if [ -z "$force" ] && [ -e "$rendezvous/failed" ]; then
log "Starting session already failed, not trying again."
log "Remove $rendezvous/failed to retry."
exit 70 # EX_SOFTWARE
fi
rm -f "$rendezvous/fifo"
mkfifo "$rendezvous/fifo"
......@@ -156,6 +170,7 @@ socket=$(
)
if [ -z "$socket" ] || ! [ -S "$socket" ]; then
: > "$rendezvous/failed"
log "Error starting pressure-vessel container"
if [ -z "${PRESSURE_VESSEL_VERBOSE-}" ]; then
log "Try environment variable PRESSURE_VESSEL_VERBOSE=1 for more details"
......
......@@ -306,6 +306,7 @@ env \
-u SteamGameId \
-u SteamOverlayGameId \
"${here}/_start-container-in-background" \
${is_main:+--force} \
--session="$rendezvous" \
--suite="$suite" \
-- \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment