mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-07-12 12:01:32 +02:00
so-salt-minion-check: highstate after minion restart
When the minion is deemed hung and restarted, wait for it to become ready via so-salt-minion-wait, then kick off salt-call state.highstate (queued, backgrounded) so the box re-applies its states and recovers on its own rather than waiting for the next scheduled highstate.
This commit is contained in:
@@ -91,6 +91,8 @@ if [ $CURRENT_TIME -ge $((SYSTEM_START_TIME+$UPTIME_REQ)) ]; then
|
||||
logCmd "pkill -9 -ef /usr/bin/salt-minion" I
|
||||
log "starting salt-minion service" I
|
||||
logCmd "systemctl start salt-minion" I
|
||||
log "waiting for salt-minion to become ready, then applying highstate in the background (queued)" I
|
||||
nohup bash -c '/usr/sbin/so-salt-minion-wait; salt-call state.highstate queue=True' >> "/opt/so/log/salt/so-salt-minion-check" 2>&1 &
|
||||
else
|
||||
log "/opt/so/log/salt/healthcheck-state-apply last touched: `date -d @$LAST_HEALTHCHECK_STATE_APPLY` must be touched by `date -d @$THRESHOLD_DATE` to avoid salt-minion restart" I
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user