mirror of https://github.com/apache/cloudstack.git
kvmsmpheartbeat.sh: honour kvm.heartbeat.fence.action
Per @weizhouapache's review on #13090, kvmsmpheartbeat.sh was still hard-coding the immediate-reboot fence action (echo b > /proc/sysrq-trigger) while kvmheartbeat.sh and kvmspheartbeat.sh delegate to kvmha-fence.sh. Source kvmha-fence.sh and call fence_action so this script picks up the same hard-reboot / graceful-reboot / restart-agent / log-only / custom behaviour from agent.properties. Default behaviour (no property set) remains hard-reboot via sysrq-trigger, so existing deployments are unaffected.
This commit is contained in:
parent
4a8f0af96d
commit
5f46b1f653
|
|
@ -207,11 +207,13 @@ then
|
|||
exit 0
|
||||
elif [ "$cflag" == "1" ]
|
||||
then
|
||||
/usr/bin/logger -t heartbeat "kvmsmpheartbeat.sh will reboot system because it was unable to write the heartbeat to the storage."
|
||||
sync &
|
||||
sleep 5
|
||||
echo b > /proc/sysrq-trigger
|
||||
exit $?
|
||||
# Delegate the fence action to the shared helper so this script honours the
|
||||
# kvm.heartbeat.fence.action property (hard-reboot / graceful-reboot /
|
||||
# restart-agent / log-only / custom) like kvmheartbeat.sh and kvmspheartbeat.sh.
|
||||
# Default (no property set) remains hard-reboot via sysrq-trigger.
|
||||
# shellcheck disable=SC1091
|
||||
. "$(dirname "$0")/kvmha-fence.sh"
|
||||
fence_action "kvmsmpheartbeat.sh"
|
||||
else
|
||||
write_hbLog
|
||||
exit $?
|
||||
|
|
|
|||
Loading…
Reference in New Issue