Posted under » AWS on 05 April 2026
AWS will want to optimise their CPU and RAM usage in ther data centers. If your EC2s are idle it will reboot them without your consent.
You can try tp disable this reboot nonsense in the AWS dashboard under Actions » instance settings » 'Change stop protection'
If it doesn't not work, you can simulate writting to disk via cron using touch which has worked for moi.
*/5 * * * * touch /home/ubuntu/.stayawake