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

(MODULES-11149) Modify result of 'last' to remove current time #305

Merged

Conversation

nmburgan
Copy link

@nmburgan nmburgan commented Aug 12, 2021

When doing 'last -1 reboot', the end of this line will show the current time on some platforms, since it shows both the start and end time of the session. Since the plan is simply comparing the raw string to see if we've rebooted, this makes it think we've always rebooted, since the end of this string changes every second. This commit slices off the end time, leaving only the login time.

@nmburgan nmburgan requested a review from a team as a code owner August 12, 2021 00:14
@nmburgan nmburgan force-pushed the maint/main/modify_last_boot_tim_nix branch from eb9a9dd to 26bf55b Compare August 12, 2021 00:19
@nmburgan
Copy link
Author

nmburgan commented Aug 16, 2021

Tested on all the platforms listed on https://puppet.com/docs/pe/2021.2/patch_management_setup.html. This appears to affect RedHat-based 6/7 (centos, RHEL, Scientific, Oracle) as well as SLES 12. Other platforms just have still running at the end instead of the updating current time.

When doing 'last -1 reboot', the end of this line will show the current time, since it shows both the start and end time of the session. Since the plan is simply comparing the raw string to see if we've rebooted, this makes it think we've always rebooted, since the end of this string changes every second. This commit slices off the end time, leaving only the login time.
@nmburgan nmburgan force-pushed the maint/main/modify_last_boot_tim_nix branch from 26bf55b to df65573 Compare August 16, 2021 23:13
@nmburgan nmburgan changed the title (maint) Modify result of 'last' to remove current time (MODULES-11149) Modify result of 'last' to remove current time Aug 16, 2021
@daianamezdrea daianamezdrea merged commit e7138b7 into puppetlabs:main Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants