mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
dont exit if salt isnt running
This commit is contained in:
@@ -460,7 +460,6 @@ stop_salt_master() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Killing any queued Salt jobs on the manager."
|
echo "Killing any queued Salt jobs on the manager."
|
||||||
pkill -9 -ef "/usr/bin/python3 /bin/salt" >> $SOUP_LOG 2>&1
|
pkill -9 -ef "/usr/bin/python3 /bin/salt" >> $SOUP_LOG 2>&1
|
||||||
set -e
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Storing salt-master pid."
|
echo "Storing salt-master pid."
|
||||||
@@ -468,6 +467,7 @@ stop_salt_master() {
|
|||||||
echo "Found salt-master PID $MASTERPID"
|
echo "Found salt-master PID $MASTERPID"
|
||||||
systemctl_func "stop" "salt-master"
|
systemctl_func "stop" "salt-master"
|
||||||
timeout 30 tail --pid=$MASTERPID -f /dev/null || echo "salt-master still running at $(date +"%T.%6N") after waiting 30s. We cannot kill due to systemd restart option."
|
timeout 30 tail --pid=$MASTERPID -f /dev/null || echo "salt-master still running at $(date +"%T.%6N") after waiting 30s. We cannot kill due to systemd restart option."
|
||||||
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_salt_minion() {
|
stop_salt_minion() {
|
||||||
@@ -480,14 +480,12 @@ stop_salt_minion() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "Killing Salt jobs on this node."
|
echo "Killing Salt jobs on this node."
|
||||||
salt-call saltutil.kill_all_jobs --local
|
salt-call saltutil.kill_all_jobs --local
|
||||||
set -e
|
|
||||||
|
|
||||||
echo "Storing salt-minion pid."
|
echo "Storing salt-minion pid."
|
||||||
MINIONPID=$(pgrep -f '/opt/saltstack/salt/bin/python3.10 /usr/bin/salt-minion' | head -1)
|
MINIONPID=$(pgrep -f '/opt/saltstack/salt/bin/python3.10 /usr/bin/salt-minion' | head -1)
|
||||||
echo "Found salt-minion PID $MINIONPID"
|
echo "Found salt-minion PID $MINIONPID"
|
||||||
systemctl_func "stop" "salt-minion"
|
systemctl_func "stop" "salt-minion"
|
||||||
|
|
||||||
set +e
|
|
||||||
timeout 30 tail --pid=$MINIONPID -f /dev/null || echo "Killing salt-minion at $(date +"%T.%6N") after waiting 30s" && pkill -9 -ef /usr/bin/salt-minion
|
timeout 30 tail --pid=$MINIONPID -f /dev/null || echo "Killing salt-minion at $(date +"%T.%6N") after waiting 30s" && pkill -9 -ef /usr/bin/salt-minion
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user