Always use /proc/sys/kernel/random/boot_id to confirm reboot on Linux (#47017)

* Always use /proc/sys/kernel/random/boot_id to confirm reboot on Linux

/proc/sys/kernel/random/boot_id is available since kernel 2.3.16 and
should be safe to rely on.

The previously used method by checking the system boot time using who -b
turned out to be unreliable: Some systems lacking an RTC report the Unix
epoch as boot time, but the code trying to detect that did't always
work.

Closes #46562

* Change DEFAULT_BOOT_TIME_COMMAND

- change to usinsg /proc by default
- add BOOT_TIME_COMMANDS for BSD, Solaris, and macOS
This commit is contained in:
Stefan Siegel 2018-11-08 15:54:58 +01:00 committed by Sam Doran
commit ae7b9ea8cd
2 changed files with 8 additions and 19 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- reboot - change default reboot time command to prevent hanging on certain systems (https://github.com/ansible/ansible/issues/46562)