I have an application (Django) running in a docker container on a cloud provider. For various reasons it would be useful for me to know when the host itself rebooted, and to save this event somewhere e.g. a database. Obviously it's easy to detect when the application itself starts, but this could have been caused by something other than host reboot. I could in theory catch SIGTERM but again this doesn't necessarily mean a host reboot.
As usual while writing this question I've realised that I could just call uptime
and pass through /proc/uptime
if necessary, but is this the best way?