5539: Retry keepproxy if it quits (this happens when restarting the container,
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 24 Mar 2015 02:36:01 +0000 (22:36 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 24 Mar 2015 02:36:01 +0000 (22:36 -0400)
the api server isn't ready yet, so need to keep trying).

docker/keepproxy/run-keepproxy.in

index 08fc4414bfdef0194324d5955095a60549464b1c..4bd934d5b36e1e6f88a5eb8c2085c04f667547a0 100755 (executable)
@@ -6,4 +6,10 @@ export ARVADOS_API_HOST_INSECURE=yes
 # to get one while building the images
 export ARVADOS_API_TOKEN=@@API_SUPERUSER_SECRET@@
 
-exec keepproxy -listen=':9100'
+read pid cmd state ppid pgrp session tty_nr tpgid rest < /proc/self/stat
+trap "kill -TERM -$pgrp; exit" HUP EXIT TERM QUIT
+
+while /bin/true ; do
+    keepproxy -listen=':9100'
+    sleep 1
+done