Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(446)

Unified Diff: blimp/engine/start_engine.sh

Issue 1844733003: Restart the engine within the docker container when appropriate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/engine/start_engine.sh
diff --git a/blimp/engine/start_engine.sh b/blimp/engine/start_engine.sh
index 519f31707744dfa56e4f4f65fa8da8586b5aac75..96c90d06913d2062ff7efcf090e67362ce8bde2a 100755
--- a/blimp/engine/start_engine.sh
+++ b/blimp/engine/start_engine.sh
@@ -4,18 +4,31 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+# Luanch stunnel once and only once. This should never crash, but if it does,
+# everything should die.
stunnel \
-p /engine/data/stunnel.pem \
-P /engine/stunnel.pid \
-d 25466 -r 25467 -f &
-LD_LIBRARY_PATH=/engine/ /engine/blimp_engine_app \
- --disable-gpu \
- --use-remote-compositing \
- --disable-cached-picture-raster \
- --blimp-client-token-path=/engine/data/client_token \
- --android-fonts-path=/engine/fonts \
- --disable-remote-fonts \
- $@ &
-# Stop execution if either stunnel or blimp_engine_app die.
-wait -n
+# Start (and restart) the engine so long as there hasn't been an error.
+# Currently, the engine can cleanly exit in the event that a conneciton is lost.
+# In these cases, it's safe to restart the engine. However, if either stunnel or
+# the engine exit with a nonzero return code, stop all execution.
+while :; do
+ LD_LIBRARY_PATH=/engine/ /engine/blimp_engine_app \
+ --disable-gpu \
+ --use-remote-compositing \
+ --disable-cached-picture-raster \
+ --blimp-client-token-path=/engine/data/client_token \
+ --android-fonts-path=/engine/fonts \
+ --disable-remote-fonts \
+ $@ &
+
+ # Wait for a process to exit. Bomb out if anything had an error.
+ wait -n # Returns the exited process's return code.
+ retcode=$?
+ if [ $retcode -ne 0 ]; then
+ exit $retcode
+ fi
+done
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698