Package: rsyslog
Version: 8.2408.0-1
Severity: wishlist
Tags: patch
X-Debbugs-Cc: plore...@disroot.org


Hello,

the way log rotation is performed in this package makes it very hard
for pacakges like orphan-sysvinit-scripts and runit-services to support
rsyslogd. (this is also reported in #1031399)
the problem is that currently log files are rotated by logrotate but
rsyslogd does not receive HUP so it continues to write to rotated files
instead of write to new ones.

Compared to #1031399 I propose a  minimalistic fix; intead of directly
call /usr/lib/rsyslog/rsyslog-rotate in /etc/logrotate.d/rsyslog, turn
/usr/lib/rsyslog/ in a directory where other packages (orphan-sysvinit-scripts,
runit-services) can drop their shell snippets.

patch is below, in my opinion this would also fix #1031399.
I'm also doing a MR on salsa, in case you prefer that way
https://salsa.debian.org/debian/rsyslog/-/merge_requests/10

Thanks,
Lorenzo
 
>From 5a111b8068ef1fec918710e756d9349b6d0fc707 Mon Sep 17 00:00:00 2001
From: Lorenzo Puliti <lorenzo.r...@gmail.com>
Date: Wed, 21 Aug 2024 21:19:09 +0000
Subject: [PATCH] rsyslog.logrotate: allow shell fragment in postrotate

allow shell fragments in logrotate's postrotate section so that
pacakges like orphan-sysvinit-scripts and runit-services can
simlpy drop their snippets in /usr/lib/rsyslog
---
 debian/rsyslog.logrotate | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rsyslog.logrotate b/debian/rsyslog.logrotate
index b145324f..d6289947 100644
--- a/debian/rsyslog.logrotate
+++ b/debian/rsyslog.logrotate
@@ -13,6 +13,6 @@
        delaycompress
        sharedscripts
        postrotate
-               /usr/lib/rsyslog/rsyslog-rotate
+               for f in /usr/lib/rsyslog/*; do "$f" ; done
        endscript
 }
-- 
2.45.2



-- System Information:
Debian Release: trixie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 6.8.12-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: runit (via /run/runit.stopit)
LSM: AppArmor: enabled

Versions of packages rsyslog depends on:
ii  libc6         2.39-7
ii  libestr0      0.1.11-1+b1
ii  libfastjson4  1.2304.0-1+b1
ii  liblognorm5   2.0.6-4+b1
ii  libsystemd0   256.5-1
ii  libuuid1      2.40.2-7
ii  libzstd1      1.5.6+dfsg-1
ii  zlib1g        1:1.3.dfsg+really1.3.1-1

Versions of packages rsyslog recommends:
ii  logrotate  3.22.0-1

Versions of packages rsyslog suggests:
pn  rsyslog-doc                       <none>
pn  rsyslog-gssapi                    <none>
pn  rsyslog-mongodb                   <none>
pn  rsyslog-mysql | rsyslog-pgsql     <none>
pn  rsyslog-openssl | rsyslog-gnutls  <none>
pn  rsyslog-relp                      <none>

-- Configuration Files:
/etc/logrotate.d/rsyslog [Errno 2] No such file or directory: 
'/etc/logrotate.d/rsyslog'

Reply via email to