From 6d3465626eaa75f2fb341b7f03b4c4c1aa280dde Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 24 Oct 2023 12:52:25 -0400 Subject: [PATCH] if deb fam, stop salt-master and salt-minion after salt upgrade --- salt/common/tools/sbin/so-common | 2 +- salt/manager/tools/sbin/soup | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/salt/common/tools/sbin/so-common b/salt/common/tools/sbin/so-common index a2ac96ece..87f40c9d4 100755 --- a/salt/common/tools/sbin/so-common +++ b/salt/common/tools/sbin/so-common @@ -453,7 +453,7 @@ wait_for_salt_minion() { local maxAttempts=20 until check_salt_minion_status "$minion" "$timeout" "$logfile"; do attempt=$((attempt+1)) - if [[ $attempt -gt $maxAttempts ]]; then + if [[ $attempt -eq $maxAttempts ]]; then return 1 fi sleep 10 diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 48c3e543d..e3c3b15a7 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -866,6 +866,16 @@ main() { echo "Upgrading Salt" # Update the repo files so it can actually upgrade upgrade_salt + + # for Debian based distro, we need to stop salt again after upgrade output below is from bootstrap-salt + # * WARN: Not starting daemons on Debian based distributions + # is not working mostly because starting them is the default behaviour. + if [[ $is_deb ]]; then + systemctl status salt-master + systemctl status salt-minion + stop_salt_master + stop_salt_minion + fi fi preupgrade_changes