| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright 2016 The Chromium Authors. All rights reserved. | 3 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Luanch stunnel once and only once. This should never crash, but if it does, | 7 # Launch stunnel once and only once. This should never crash, but if it does, |
| 8 # everything should die. | 8 # everything should die. |
| 9 stunnel \ | 9 stunnel \ |
| 10 -p /engine/data/stunnel.pem \ | 10 -p /engine/data/stunnel.pem \ |
| 11 -P /engine/stunnel.pid \ | 11 -P /engine/stunnel.pid \ |
| 12 -d 25466 -r 25467 -f & | 12 -d 25466 -r 25467 -f & |
| 13 | 13 |
| 14 # Start (and restart) the engine so long as there hasn't been an error. | 14 # Start (and restart) the engine so long as there hasn't been an error. |
| 15 # Currently, the engine can cleanly exit in the event that a connection is lost. | 15 # Currently, the engine can cleanly exit in the event that a connection is lost. |
| 16 # In these cases, it's safe to restart the engine. However, if either stunnel or | 16 # In these cases, it's safe to restart the engine. However, if either stunnel or |
| 17 # the engine exit with a nonzero return code, stop all execution. | 17 # the engine exit with a nonzero return code, stop all execution. |
| 18 while :; do | 18 while :; do |
| 19 LD_LIBRARY_PATH=/engine/ /engine/blimp_engine_app \ | 19 LD_LIBRARY_PATH=/engine/ /engine/blimp_engine_app \ |
| 20 --android-fonts-path=/engine/fonts/font_bundle/marshmallow \ | 20 --android-fonts-path=/engine/fonts/font_bundle/marshmallow \ |
| 21 --blimp-client-token-path=/engine/data/client_token \ | 21 --blimp-client-token-path=/engine/data/client_token \ |
| 22 --vmodule="remote_channel_main=1,blimp*=1" \ |
| 22 $@ & | 23 $@ & |
| 23 | 24 |
| 24 # Wait for a process to exit. Bomb out if anything had an error. | 25 # Wait for a process to exit. Bomb out if anything had an error. |
| 25 wait -n # Returns the exited process's return code. | 26 wait -n # Returns the exited process's return code. |
| 26 retcode=$? | 27 retcode=$? |
| 27 if [ $retcode -ne 0 ]; then | 28 if [ $retcode -ne 0 ]; then |
| 28 exit $retcode | 29 exit $retcode |
| 29 fi | 30 fi |
| 30 done | 31 done |
| OLD | NEW |