My application needs to know if the system has rebooted since the last time it was run. The current strategy I have is to persist a reboot ID that I generate with the following command:
last -f /var/run/utmp | egrep '^reboot' | md5sum | cut -d' ' -f1
Any other ideas?
Linux kernel exports a unique identifier after each boot:
$ cat /proc/sys/kernel/random/boot_id
a30d49a3-612e-1132-a2b7-c34r01c5ed1r
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With