Skip to content

Commit 7bce656

Browse files
committed
make sure sync cannot block reboot
The recent discussed improvement has the risk that if 'sync' hangs, the reboot may be delayed in the same way as the 'reboot' command would do. To work around, we're adding a 5 second timeout. If it cannot sync in 5 seconds, it will not succeed anyway and we should proceed the reset. @snuf: Could we use your OVM3 heartbeat script for other hypervisors as well? One way to do it seems like a nice idea :-)
1 parent 770297e commit 7bce656

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/vm/hypervisor/kvm/kvmheartbeat.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ then
156156
elif [ "$cflag" == "1" ]
157157
then
158158
/usr/bin/logger -t heartbeat "kvmheartbeat.sh rebooted system because it was unable to write the heartbeat to the storage."
159-
sync
159+
sync &
160+
sleep 5
160161
echo b > /proc/sysrq-trigger
161162
exit $?
162163
else

0 commit comments

Comments
 (0)