diff options
author | Zach Koopmans <zkoopmans@google.com> | 2020-02-21 13:17:44 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2020-02-21 13:18:51 -0800 |
commit | 3733499952c056cc8496beb01c72dcf53177048e (patch) | |
tree | 3fa6f3cab2858c473e80b77846a5c878b84cd100 /tools/installers/master.sh | |
parent | a155a23480abfafe096ff50f2c4aaf2c215b6c44 (diff) |
Fix master installer.
Sometimes, when we start a new instance, the file
lock on "apt" is locked. Add a loop to the master
installer.
In addition, the "apt-get install" fails to register
runsc in docker, so run the appropriate scripts to
get that to happen.
Also, add some helpful log messages.
PiperOrigin-RevId: 296497357
Diffstat (limited to 'tools/installers/master.sh')
-rwxr-xr-x | tools/installers/master.sh | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/installers/master.sh b/tools/installers/master.sh index 7b1956454..52f9734a6 100755 --- a/tools/installers/master.sh +++ b/tools/installers/master.sh @@ -15,6 +15,21 @@ # limitations under the License. # Install runsc from the master branch. +set -e + curl -fsSL https://gvisor.dev/archive.key | sudo apt-key add - add-apt-repository "deb https://storage.googleapis.com/gvisor/releases release main" -apt-get update && apt-get install -y runsc +while true; do + if apt-get update; then + apt-get install -y runsc + break + fi + result=$? + # Check if apt update failed to aquire the file lock. + if [[ $result -ne 100 ]]; then + exit $result + fi +done +runsc install +service docker restart + |