From be644b2cebe9af94d7a39c3a125d584f44425b01 Mon Sep 17 00:00:00 2001 From: Ed King Date: Thu, 15 Mar 2018 12:08:30 +0000 Subject: [PATCH] Bump garden's monit timeout to 120 seconds The previous timeout was the default of 30 seconds. Also added a few debug log lines to garden_start to give us an indication of where time is being spent during startup. [#155981388] --- jobs/garden/monit | 2 +- jobs/garden/templates/bin/garden_start.erb | 9 +++++++++ src/greenskeeper/scripts/system-preparation | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/jobs/garden/monit b/jobs/garden/monit index d037e2ceb..4bfef1a31 100644 --- a/jobs/garden/monit +++ b/jobs/garden/monit @@ -1,6 +1,6 @@ check process garden with pidfile /var/vcap/sys/run/garden/garden.pid - start program "/bin/sh -c '/var/vcap/jobs/garden/bin/garden_start'" + start program "/bin/sh -c '/var/vcap/jobs/garden/bin/garden_start'" with timeout 120 seconds stop program "/var/vcap/jobs/garden/bin/garden_stop" <% if p("garden.listen_network") == "unix" %> if failed unixsocket <%= p("garden.listen_address") %> diff --git a/jobs/garden/templates/bin/garden_start.erb b/jobs/garden/templates/bin/garden_start.erb index 3cd19c7d2..ef213a6a8 100644 --- a/jobs/garden/templates/bin/garden_start.erb +++ b/jobs/garden/templates/bin/garden_start.erb @@ -18,15 +18,21 @@ exec 2>> "${MONIT_DIR}/garden.err.log" rm -f "$RUNTIME_BIN_DIR"/init cp /var/vcap/packages/guardian/bin/init "$RUNTIME_BIN_DIR"/init +log "preparing system" permit_device_control create_loop_devices 256 +log "done" <% if !p("garden.deprecated_use_garden_shed") && p("garden.image_plugin", "") == "" %> +log "configuring overlay" ${BASE_PATH}/overlay-xfs-setup +log "done" <% end %> +log "running thresholder" /var/vcap/packages/thresholder/bin/thresholder "<%= p("garden.graph_cleanup_threshold_in_mb") %>" "<%= p("grootfs.graph_cleanup_threshold_in_mb") %>" "<%= p("grootfs.reserved_space_for_other_jobs_in_mb") %>" "$DATA_DIR" "$GARDEN_CONFIG_DIR/grootfs_config.yml" /var/vcap/packages/thresholder/bin/thresholder "<%= p("garden.graph_cleanup_threshold_in_mb") %>" "<%= p("grootfs.graph_cleanup_threshold_in_mb") %>" "<%= p("grootfs.reserved_space_for_other_jobs_in_mb") %>" "$DATA_DIR" "$GARDEN_CONFIG_DIR/privileged_grootfs_config.yml" +log "done" <% if p("garden.apparmor_profile") == "garden-default" %> load_apparmor_profile "$GARDEN_CONFIG_DIR"/garden-default @@ -78,10 +84,13 @@ garden_configfile_path="$GARDEN_CONFIG_DIR/config.ini" garden_configfile_path="$garden_rootless_config_dir/config.ini" <% end %> +log "running setup" $setup_cmd +log "done" echo $$ > $PIDFILE +log "running gdn" $exec_command /var/vcap/packages/guardian/bin/gdn \ --config "$garden_configfile_path" \ server \ diff --git a/src/greenskeeper/scripts/system-preparation b/src/greenskeeper/scripts/system-preparation index 316804ff1..bc5800bfe 100644 --- a/src/greenskeeper/scripts/system-preparation +++ b/src/greenskeeper/scripts/system-preparation @@ -46,3 +46,7 @@ function load_apparmor_profile() { apparmor_parser -r "$profile_path" } +function log() { + local msg=$1 + echo "$(date) - $msg" +}