Skip to content

Commit 1143903

Browse files
committed
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.
1 parent 8223739 commit 1143903

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

scripts/vm/hypervisor/kvm/kvmsmpheartbeat.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,13 @@ then
207207
exit 0
208208
elif [ "$cflag" == "1" ]
209209
then
210-
/usr/bin/logger -t heartbeat "kvmsmpheartbeat.sh will reboot system because it was unable to write the heartbeat to the storage."
211-
sync &
212-
sleep 5
213-
echo b > /proc/sysrq-trigger
214-
exit $?
210+
# Delegate the fence action to the shared helper so this script honours the
211+
# kvm.heartbeat.fence.action property (hard-reboot / graceful-reboot /
212+
# restart-agent / log-only / custom) like kvmheartbeat.sh and kvmspheartbeat.sh.
213+
# Default (no property set) remains hard-reboot via sysrq-trigger.
214+
# shellcheck disable=SC1091
215+
. "$(dirname "$0")/kvmha-fence.sh"
216+
fence_action "kvmsmpheartbeat.sh"
215217
else
216218
write_hbLog
217219
exit $?

0 commit comments

Comments
 (0)