:: Re: [DNG] Log rotation keeps rotate…
Pàgina inicial
Delete this message
Reply to this message
Autor: dng@d404.nl
Data:  
A: dng
Assumpte: Re: [DNG] Log rotation keeps rotated file open
On 21-05-2024 18:15, kc-devuan@??? wrote:
> 21 May 2024 16:39:13 Dan Purgert via Dng<dng@???>:
>
>> Check the configuration, as I recall those should have a postrotate
>> script (/usr/lib/rsyslog/rsyslog-rotate) running to restart syslog.
>>
>> Config is /etc/logrotate.d/rsyslog here (pulled forward from Chimaera).
> The postrotate config and script are present with the script running
> invoke-rc.d rsyslog rotate > /dev/null
>
> I am running runit. restarting rsyslog seemed to fix it. If it happens again then I will take a closer look.
>
> Thanks
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng



I noticed something similar by running a docker container with runit (do
not ask why).

The default /etc/logrotate.d/rsyslog calls
/usr/lib/rsyslog/rsyslog-rotate which in turn checks for

if [ -d /run/systemd/system ]; then
    systemctl kill -s HUP rsyslog.service
else
    invoke-rc.d rsyslog rotate > /dev/null
fi

but does not restart rsyslog as it should. Most likely a problem with
the PATH to /usr/sbin/ where both binaries reside if present.

I took a shortcut  and replaced in /etc/logrotate.d/rsyslog

/usr/lib/rsyslog/rsyslog-rotate with /usr/sbin/service rsyslog rotate


Grtz.

Nick