| 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, |
| 8 # everything should die. |
| 7 stunnel \ | 9 stunnel \ |
| 8 -p /engine/data/stunnel.pem \ | 10 -p /engine/data/stunnel.pem \ |
| 9 -P /engine/stunnel.pid \ | 11 -P /engine/stunnel.pid \ |
| 10 -d 25466 -r 25467 -f & | 12 -d 25466 -r 25467 -f & |
| 11 LD_LIBRARY_PATH=/engine/ /engine/blimp_engine_app \ | |
| 12 --disable-gpu \ | |
| 13 --use-remote-compositing \ | |
| 14 --disable-cached-picture-raster \ | |
| 15 --blimp-client-token-path=/engine/data/client_token \ | |
| 16 --android-fonts-path=/engine/fonts \ | |
| 17 --disable-remote-fonts \ | |
| 18 $@ & | |
| 19 | 13 |
| 20 # Stop execution if either stunnel or blimp_engine_app die. | 14 # Start (and restart) the engine so long as there hasn't been an error. |
| 21 wait -n | 15 # Currently, the engine can cleanly exit in the event that a conneciton is lost. |
| 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. |
| 18 while :; do |
| 19 LD_LIBRARY_PATH=/engine/ /engine/blimp_engine_app \ |
| 20 --disable-gpu \ |
| 21 --use-remote-compositing \ |
| 22 --disable-cached-picture-raster \ |
| 23 --blimp-client-token-path=/engine/data/client_token \ |
| 24 --android-fonts-path=/engine/fonts \ |
| 25 --disable-remote-fonts \ |
| 26 $@ & |
| 27 |
| 28 # Wait for a process to exit. Bomb out if anything had an error. |
| 29 wait -n # Returns the exited process's return code. |
| 30 retcode=$? |
| 31 if [ $retcode -ne 0 ]; then |
| 32 exit $retcode |
| 33 fi |
| 34 done |
| OLD | NEW |