From bc8f65b90ceaed17275ed93e49b5fe5e245590e6 Mon Sep 17 00:00:00 2001 From: Andrei Suciu Date: Fri, 6 May 2022 11:53:28 +0300 Subject: [PATCH] Debian: Fix logrotate for services -remove btmp and wtmp log configs; on Debian they already configured in /etc/logrotate.d -merge /etc/logrotate.d/syslog configured by syslog-ng-core packet on Debian with custom syslog-ng Test Plan: PASSED: build packages and image PASSED: test logrotate -d /etc/logrotate.conf after loading the image PASSED: test logrotate -d /etc/logrotate.conf after bootstrap PASSED: test correct unlock (system host-list, alarm-list, application-list) Story: 2010036 Task: 43352 Signed-off-by: Andrei Suciu Change-Id: I2508953f56b19bbb8faf50beae3377f27e3d0503 --- logrotate-config/source-debian/logrotate.conf | 15 ------------ .../debian-source/syslog-ng.logrotate | 24 ++++++++++++++++--- syslog-ng-config/debian/deb_folder/postinst | 2 +- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/logrotate-config/source-debian/logrotate.conf b/logrotate-config/source-debian/logrotate.conf index 17e7fb4..c8e901b 100644 --- a/logrotate-config/source-debian/logrotate.conf +++ b/logrotate-config/source-debian/logrotate.conf @@ -20,19 +20,4 @@ su root root # RPM packages drop log rotation information into this directory include /etc/logrotate.d -# no packages own wtmp and btmp -- we'll rotate them here -/var/log/wtmp { - monthly - create 0664 root utmp - minsize 1M - rotate 1 -} - -/var/log/btmp { - missingok - monthly - create 0600 root utmp - rotate 1 -} - # system-specific logs may be also be configured here. diff --git a/syslog-ng-config/debian-source/syslog-ng.logrotate b/syslog-ng-config/debian-source/syslog-ng.logrotate index ab6bcf9..d89e025 100644 --- a/syslog-ng-config/debian-source/syslog-ng.logrotate +++ b/syslog-ng-config/debian-source/syslog-ng.logrotate @@ -1,5 +1,4 @@ -# /etc/logrotate.d/syslog-ng - Provided by syslog-ng-logrotate - +# /etc/logrotate.d/syslog-ng - Provided by syslog-ng-logrotate and merged with syslog.logrotate /var/log/syslog /var/log/auth.log /var/log/cron.log @@ -8,6 +7,9 @@ /var/log/containerd.log /var/log/kern.log /var/log/lpr.log +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err /var/log/mail.log /var/log/news.log /var/log/user.log @@ -55,7 +57,6 @@ endscript } - /var/log/nfv-vim.log { nodateext @@ -122,3 +123,20 @@ /usr/bin/logmgmt_postrotate > /dev/null 2>&1 || true endscript } + +/var/log/debug +/var/log/messages +/var/log/error +{ + rotate 4 + weekly + missingok + notifempty + compress + delaycompress + sharedscripts + postrotate + invoke-rc.d syslog-ng reload > /dev/null + endscript +} + diff --git a/syslog-ng-config/debian/deb_folder/postinst b/syslog-ng-config/debian/deb_folder/postinst index 4fac6ac..5786989 100644 --- a/syslog-ng-config/debian/deb_folder/postinst +++ b/syslog-ng-config/debian/deb_folder/postinst @@ -3,7 +3,7 @@ set -e cp /usr/share/starlingx/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf -cp /usr/share/starlingx/syslog-ng.logrotate /etc/logrotate.d/syslog +cp /usr/share/starlingx/syslog-ng.logrotate /etc/logrotate.d/syslog-ng cp /usr/share/starlingx/syslog-ng.service /usr/lib/systemd/system/syslog-ng.service chmod 700 /usr/sbin/fm_event_syslogger