Serialize the service startup in arvbox by adding a dependency on the
[arvados.git] / tools / arvbox / lib / arvbox / docker / service / api / run-service
index 7df7b2820bf6a0b83bcb538ecb418e183e68afa8..d2691e7ed6bd2acdf96c1be2634c72fb3da30c03 100755 (executable)
@@ -17,8 +17,8 @@ else
 fi
 
 run_bundler --without=development
-bundle exec passenger-config build-native-support
-bundle exec passenger-config install-standalone-runtime
+flock $GEM_HOME/gems.lock bundle exec passenger-config build-native-support
+flock $GEM_HOME/gems.lock bundle exec passenger-config install-standalone-runtime
 
 if test "$1" = "--only-deps" ; then
     exit
@@ -31,4 +31,6 @@ if test "$1" = "--only-setup" ; then
     exit
 fi
 
+touch $ARVADOS_CONTAINER_PATH/api.ready
+
 exec bundle exec passenger start --port=${services[api]}