plugins/reboot: fix boot time command on FreeBSD

The boot time is not a fixed value [1]. It's adjusted by NTP. That's not
only an issue of FreeBSD. E.g. OpenBSD has the same issue [2]. On
FreeBSD we can use the boot_id sysctl [3]. Unfortunately, OpenBSD
doesn't have such a sysctl. So, we keep the boottime for now.

[1] https://cgit.freebsd.org/src/commit/?id=a512d0ab009eedf2f1876fce86d6386bfee626d8
[2] dd1c5868ed/sys/kern/kern_tc.c (L735)
[3] https://cgit.freebsd.org/src/commit/?id=34086d5bda29cc583755fc8948f59c3b61f8ce7d

Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
pull/82383/head
Corvin Köhne 12 months ago
parent 8af920c892
commit 8728287415
No known key found for this signature in database
GPG Key ID: D854DA56315E026A

@ -0,0 +1,2 @@
bugfixes:
- reboot - Previously, on FreeBSD the boot time was used to verify that a target really rebooted. Unfortunately, it's not a fixed value and may change e.g. due to NTP updates leading to sporadic issues. Therefore, ansible is using the boot_id sysctl now. (https://github.com/ansible/ansible/pull/82383)

@ -50,7 +50,7 @@ class ActionModule(ActionBase):
DEPRECATED_ARGS = {} # type: dict[str, str]
BOOT_TIME_COMMANDS = {
'freebsd': '/sbin/sysctl kern.boottime',
'freebsd': '/sbin/sysctl -x kern.boot_id',
'openbsd': '/sbin/sysctl kern.boottime',
'macosx': 'who -b',
'solaris': 'who -b',

Loading…
Cancel
Save