From 5a20bf1bf73e77abbbe0316635f532b0db177f37 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 3 Aug 2014 21:51:14 +0100 Subject: [PATCH] The default sleep between services checks should be 10 only on Ubuntu --- bootstrap-salt.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 12513c3..3bb2fa3 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -45,7 +45,8 @@ BS_TRUE=1 BS_FALSE=0 # Default sleep time used when waiting for daemons to start, restart and checking for these running -__DEFAULT_SLEEP=10 +__DEFAULT_SLEEP=3 +__DEFAULT_SLEEP_ORIGINAL="${__DEFAULT_SLEEP}" #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: __detect_color_support @@ -1621,6 +1622,12 @@ __enable_universe_repository() { } install_ubuntu_deps() { + if [ "${__DEFAULT_SLEEP}" -eq "${__DEFAULT_SLEEP_ORIGINAL}" ]; then + # The user did not pass a custom sleep value as an argument, let's increase the default value + echodebug "On Ubuntu systems we increase the default sleep value to 10." + echodebug "See https://github.com/saltstack/salt/issues/12248 for more info." + __DEFAULT_SLEEP=10 + fi if [ $_START_DAEMONS -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi @@ -1695,7 +1702,7 @@ install_ubuntu_deps() { } install_ubuntu_daily_deps() { - install_ubuntu_deps + install_ubuntu_deps || return 1 if [ "$DISTRO_MAJOR_VERSION" -ge 12 ]; then # Above Ubuntu 11.10 add-apt-repository is in a different package __apt_get_install_noinput software-properties-common || return 1