| 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
|
|
|