Closed ospalax closed 2 years ago
On a second thought - preventing the deletion of wtmp
and btmp
files will record the current active session - which is not desired... and on reboot these files are recreated so last
command starts working again...
I will close this as non-bug after a feedback from the sponsor.
IMHO
This was not an actual error to be fixed - the behavior is correct as is - upon running the onesysprep command the aforementioned files are deleted, the system then should be power-offed and image saved.
Upon a reboot these files are correctly recreated and last command functions correctly.
If this workaround would be merged then it would leave the last session before power-off baked in the image and therefore it would not be properly cleaned up.
It can be reopened if it really does help on some systems which do fail to create these files on reboot.
Running
onesysprep
command inside CentOS/RHEL 7 will delete/var/log/wtmp
which is needed forlast
command to work on these systems.Solution is to just truncate the file.