Skip to content

Commit

Permalink
Bump garden's monit timeout to 120 seconds
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
teddyking committed Mar 15, 2018
1 parent ebd1fb8 commit be644b2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jobs/garden/monit
Original file line number Diff line number Diff line change
@@ -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") %>
Expand Down
9 changes: 9 additions & 0 deletions jobs/garden/templates/bin/garden_start.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
4 changes: 4 additions & 0 deletions src/greenskeeper/scripts/system-preparation
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ function load_apparmor_profile() {
apparmor_parser -r "$profile_path"
}

function log() {
local msg=$1
echo "$(date) - $msg"
}

0 comments on commit be644b2

Please sign in to comment.