From ac6f1df86f30dd2818b6b2d2df2d1eb8915ba8c5 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Wed, 24 Feb 2021 12:33:36 -0500 Subject: [PATCH] [fix] Only check log_size_limit on .2X -> .30 * Since we're showing a message in the middle of soup, wait for keypress if it's shown --- salt/common/tools/sbin/soup | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/salt/common/tools/sbin/soup b/salt/common/tools/sbin/soup index 1a33a7895..76addeb13 100755 --- a/salt/common/tools/sbin/soup +++ b/salt/common/tools/sbin/soup @@ -121,10 +121,13 @@ check_sudoers() { } check_log_size_limit() { + local wait_for_enter=false + local num_minion_pillars num_minion_pillars=$(find /opt/so/saltstack/local/pillar/minions/ -type f | wc -l) if [[ $num_minion_pillars -gt 1 ]]; then + wait_for_enter=true echo "[INFO] The value of log_size_limit in the minion pillars may be incorrect." echo " -> We recommend checking and adjusting the values as necessary." else @@ -166,9 +169,16 @@ check_log_size_limit() { new_limit=$( echo "$disk_size_gb" "$percent" | awk '{printf("%.0f", $1 * ($2/100))}') if [[ $current_limit != "$new_limit" ]]; then + wait_for_enter=true echo "[WARNING] The value of log_size_limit (${current_limit}) does not match the recommended value of ${new_limit}." echo " -> We recommend checking and adjusting the value as necessary." fi + + if [[ $wait_for_enter == true ]]; then + echo "" + read -n 1 -s -r -p "Press any key to continue..." + echo "" # Since read doesn't print a newline, print one for it + fi fi } @@ -392,6 +402,7 @@ up_2.3.2X_to_2.3.30() { for pillar in "${minion_pillars[@]}"; do sed -i -r "s/ (\{\{.*}})$/ '\1'/g" "$pillar" done + check_log_size_limit } space_check() { @@ -714,7 +725,7 @@ fi check_sudoers -check_log_size_limit + }