balena-os / balenahup

BALENA Host os UPdater
https://balena.io/
36 stars 11 forks source link

Log message when a force reboot is required #349

Open alexgg opened 3 years ago

alexgg commented 3 years ago

The HUP script is currently performing the reboot as follows:

# Reboot into new OS                                                    
 847         log "Rebooting into new OS in 5 seconds..."                             
 848         progress 100 "Update successful, rebooting"                             
 849         systemd-run --on-active=5 --quiet --unit=hup-reboot.service systemctl reboot
 850         # If the previous reboot command has failed for any reason, let's try differently
 851         (sleep 300 && nohup bash -c "reboot --force" > /dev/null 2>&1) &        
 852         # If the previous 2 reboot commands have failed for any reason, try the Magic SysRq
 853         # enable and send reboot request                                        
 854         (sleep 600 && echo 1 > /proc/sys/kernel/sysrq && echo b > /proc/sysrq-trigger) &

We should be logging a message if the 300s timeout is reached and a force reboot is required as this might cause data loss and fs corruption.

jellyfish-bot commented 3 years ago

[alexgg] This issue has attached support thread https://jel.ly.fish/2039f477-0844-4f5c-b4fd-029cc5298d11

jellyfish-bot commented 3 years ago

[dtischler] This issue has attached support thread https://jel.ly.fish/97bd49cd-2182-41c7-8ad8-2fccbd5906be