From cb7fd936c19201a0f0676236cd877f5aee0aa052 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 7 Nov 2023 15:58:36 +0100 Subject: [PATCH] Truncating some more logfiles --- lib/cr_vmware_tpl/handler/vm.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/cr_vmware_tpl/handler/vm.py b/lib/cr_vmware_tpl/handler/vm.py index 604e0cf..8d5737c 100644 --- a/lib/cr_vmware_tpl/handler/vm.py +++ b/lib/cr_vmware_tpl/handler/vm.py @@ -26,7 +26,7 @@ from fb_tools.errors import HandlerError, ExpectedHandlerError from .. import print_section_start, print_section_end from ..xlate import XLATOR -__version__ = '0.2.5' +__version__ = '0.2.6' LOG = logging.getLogger(__name__) @@ -286,12 +286,16 @@ class HandlerVmMixin(): print_section_start('post_install_tasks', 'Exec post install tasks ...', collapsed=True) logfiles = ( + '/var/log/audit/audit.log', '/var/log/boot.log', + '/var/log/cloud-init.log', + '/var/log/cloud-init-output.log', '/var/log/cron', '/var/log/dnf*.log', '/var/log/hawkey.log', '/var/log/messages', '/var/log/secure', + '/var/log/tuned/tuned.log' '/var/log/wtmp', '/var/log/vmware-*.log*', '/var/log/yum*.log', @@ -426,6 +430,11 @@ class HandlerVmMixin(): echo "Removing SSH host keys ..." rm -v /etc/ssh/ssh_host_* + echo + echo "-----------------------------------------------------------" + echo "Cleaning lastlog ..." + lastlog --clear --user root + echo echo "-----------------------------------------------------------" echo "Clearing journal log ..." @@ -433,9 +442,10 @@ class HandlerVmMixin(): echo echo "-----------------------------------------------------------" - echo "Truncating /var/log/*tmp ..." + echo "Truncating /var/log/*tmp and /var/log/messages ..." cp -v /dev/null /var/log/btmp cp -v /dev/null /var/log/wtmp + cp -v /dev/null /var/log/messages echo echo "Sleeping some seconds ..." -- 2.39.5