Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Nov 8, 2018

Conversation

ssiegel
Copy link
Contributor

@ssiegel ssiegel commented Oct 13, 2018

SUMMARY

/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.

Fixes #46562
Fixes #47371

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

reboot.py

ANSIBLE VERSION
ansible 2.7.0
  config file = None
  configured module search path = [u'/home/stefan/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/stefan/.local/venvs/ansible/lib/python2.7/site-packages/ansible
  executable location = /home/stefan/.local/bin/ansible
  python version = 2.7.14 (default, Oct 12 2017, 15:50:02) [GCC]
ADDITIONAL INFORMATION

/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 ansible#46562
@ansibot
Copy link
Contributor

ansibot commented Oct 14, 2018

Hi @ssiegel, thank you for submitting this pull-request!

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. labels Oct 14, 2018
@samdoran
Copy link
Contributor

Please create a changelog fragment. See fragments for examples.

@samdoran samdoran removed the needs_triage Needs a first human triage before being processed. label Oct 15, 2018
@samdoran samdoran self-assigned this Oct 15, 2018
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Oct 25, 2018
- change to usinsg /proc by default
- add BOOT_TIME_COMMANDS for BSD, Solaris, and macOS
@ansibot ansibot removed the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 7, 2018
@samdoran samdoran merged commit ae7b9ea into ansible:devel Nov 8, 2018
samdoran pushed a commit to samdoran/ansible that referenced this pull request Nov 8, 2018
…boot on Linux (ansible#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 ansible#46562

* Change DEFAULT_BOOT_TIME_COMMAND

- change to usinsg /proc by default
- add BOOT_TIME_COMMANDS for BSD, Solaris, and macOS
(cherry picked from commit ae7b9ea)

Co-authored-by: Stefan Siegel <ssiegel@sdas.net>
abadger pushed a commit that referenced this pull request Nov 9, 2018
…boot 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
(cherry picked from commit ae7b9ea)

Co-authored-by: Stefan Siegel <ssiegel@sdas.net>
mjmayer pushed a commit to mjmayer/ansible that referenced this pull request Nov 30, 2018
…ansible#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 ansible#46562

* Change DEFAULT_BOOT_TIME_COMMAND

- change to usinsg /proc by default
- add BOOT_TIME_COMMANDS for BSD, Solaris, and macOS
Tomorrow9 pushed a commit to Tomorrow9/ansible that referenced this pull request Dec 4, 2018
…ansible#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 ansible#46562

* Change DEFAULT_BOOT_TIME_COMMAND

- change to usinsg /proc by default
- add BOOT_TIME_COMMANDS for BSD, Solaris, and macOS
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SBC reboot time incorrectly parsed when TZ is set Reboot stuck on Raspbian Stretch
3 participants