diff --git a/runner/startup.sh b/runner/startup.sh index 6352a0d5..dd287f8a 100755 --- a/runner/startup.sh +++ b/runner/startup.sh @@ -1,70 +1,75 @@ -#!/bin/bash -source logger.bash +#!/usr/bin/env bash +set -Eeuo pipefail -function wait_for_process () { - local max_time_wait=30 - local process_name="$1" - local waited_sec=0 - while ! pgrep "$process_name" >/dev/null && ((waited_sec < max_time_wait)); do - log.debug "Process $process_name is not running yet. Retrying in 1 seconds" - log.debug "Waited $waited_sec seconds of $max_time_wait seconds" - sleep 1 - ((waited_sec=waited_sec+1)) - if ((waited_sec >= max_time_wait)); then - return 1 - fi - done - return 0 -} +# This path can only be customized through arguments passed to the dockerd cli +# at startup. Parsing the supervisor docker.conf file is cumbersome, and there +# is little reason to allow users to customize this. Hence, we hardcode the path +# here. +# +# See: https://docs.docker.com/engine/reference/commandline/dockerd/ +readonly dockerd_config_path=/etc/docker/daemon.json +readonly dockerd_supervisor_config_path=/etc/supervisor/conf.d/dockerd.conf -sudo /bin/bash <