Bug#1031399: rsyslog: Log rotation broken on non-systemd systems
Hi, I've provided a minimal patch; given this is a Debian-specific file and not something you're going to have to deal with upstream about, is there any chance of you applying it for bookworm, please? Log rotation isn't just about disk filling, other systems rely on its correct operation (hence my view this is RC) - I picked up on this when I realised that fail2ban had stopped working for ssh! It looks in /var/log/auth.log for entries, and that file was empty because of this failure. Thank you for your consideration, Matthew From 4f17fb24be2d1f34a772298258f2352d864e7a75 Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Fri, 17 Feb 2023 06:39:43 + Subject: [PATCH] attempt to rotate on non-systemd systems (Closes: #1031399) On non-systemd systems, /etc/init.d/rsyslog is sometimes available; in those cases, use it (via invoke-rc.d) to do log rotation. --- debian/rsyslog-rotate | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/rsyslog-rotate b/debian/rsyslog-rotate index ef3954b1..143523ab 100755 --- a/debian/rsyslog-rotate +++ b/debian/rsyslog-rotate @@ -2,4 +2,6 @@ if [ -d /run/systemd/system ]; then systemctl kill -s HUP rsyslog.service +elif [ -x /etc/init.d/rsyslog ]; then +invoke-rc.d rsyslog rotate > /dev/null fi -- 2.39.1
Bug#1031399: rsyslog: Log rotation broken on non-systemd systems
On 16/02/2023 20:43, Michael Biebl wrote: I don't plan to re-add this (btw, this would break if orphan-sysvinit-scripts is not installed). A check for the presence of the init script would not be hard (and I'd happily write it and volunteer to fix any issues with it). I'll add a note to README.Debian to the logrotate section though, what users of non-default inits need to consider. Can I urge you to reconsider, please? Unless I'm missing something there isn't a way for this to work without /usr/lib/rsyslog/rsyslog-rotate doing the "rotate" of rsyslog, since that's what /etc/logrotate.d/rsyslog calls in its postrotate. The only way this can plausibly work is if rsyslog-rotate does the rotation, and that means there has to be _some_ "else" clause in rsyslog-rotate. I'm happy to offer patches to your spec, but I really do think the rsyslog package has to do a smidge of enabling work here. Regards, Matthew
Bug#1031399: rsyslog: Log rotation broken on non-systemd systems
Control: severity -1 wishlist Control: retitle -1 document log rotation on non-default inits Am 16.02.23 um 15:41 schrieb Matthew Vernon: Package: rsyslog Version: 8.2212.0-1 Severity: serious Hi, When removing the systemv init scripts from rsyslog (which can be managed by orphan-sysvinit-scripts), the following was also removed from /usr/lib/rsyslog/rsyslog-rotate: else invoke-rc.d rsyslog rotate > /dev/null This means on non-systemd systems logrotate tries but fails to tell rsyslog to rotate its logs. Could you restore this, please? I don't plan to re-add this (btw, this would break if orphan-sysvinit-scripts is not installed). I'll add a note to README.Debian to the logrotate section though, what users of non-default inits need to consider. Michael OpenPGP_signature Description: OpenPGP digital signature
Bug#1031399: rsyslog: Log rotation broken on non-systemd systems
Package: rsyslog Version: 8.2212.0-1 Severity: serious Hi, When removing the systemv init scripts from rsyslog (which can be managed by orphan-sysvinit-scripts), the following was also removed from /usr/lib/rsyslog/rsyslog-rotate: else invoke-rc.d rsyslog rotate > /dev/null This means on non-systemd systems logrotate tries but fails to tell rsyslog to rotate its logs. Could you restore this, please? It will have no impact on systemd systems (since the else clause will never match there), and otherwise log rotation with rsyslog cannot work properly on non-systemd systems, which is quite a serious isssue. And I can't do anything about this in orphan-sysvinit-scripts. Thanks, Matthew -- System Information: Debian Release: bookworm/sid APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 6.1.0-3-amd64 (SMP w/8 CPU threads; PREEMPT) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en Shell: /bin/sh linked to /usr/bin/dash Init: sysvinit (via /sbin/init) LSM: AppArmor: enabled Versions of packages rsyslog depends on: ii libc6 2.36-8 ii libelogind0 [libsystemd0] 246.10-1debian1 ii libestr0 0.1.11-1 ii libfastjson4 0.99.9-2 ii liblognorm52.0.6-4 ii libuuid1 2.38.1-4 ii libzstd1 1.5.2+dfsg2-3 ii zlib1g 1:1.2.13.dfsg-1 Versions of packages rsyslog recommends: ii logrotate 3.21.0-1 Versions of packages rsyslog suggests: pn rsyslog-doc pn rsyslog-gssapi pn rsyslog-mongodb pn rsyslog-mysql | rsyslog-pgsql pn rsyslog-openssl | rsyslog-gnutls pn rsyslog-relp -- Configuration Files: /etc/rsyslog.conf changed [not included] -- no debconf information