Rspamd stops logging on logrotate

jigster

Verified User
Joined
Jul 23, 2021
Messages
84
Every time the rspamd logs rotate, rspamd stops logging and the new log file at /var/log/rspamd/rspamd.log is empty. Rspamd is still running and working, it's just not logging. If I restart rspamd, it immediately starts logging normally to rspamd.log... until the next log rotate!

My /etc/logrotate.d/rspamd looks like:
/var/log/rspamd/*log {
missingok
notifempty
compress
sharedscripts
postrotate
[ ! -f /var/run/rspamd.pid ] || kill -USR1 `cat /var/run/rspamd.pid`
endscript
}

Any ideas what could be causing this?
 
I think what's happening is rspamd doesn't create a pid file so the postrotate doesn't work and it keeps logging to the old log. In my case the old log is compressed so it can't log to it. Suggestions for what to put in the postrotate section of /etc/logrotate.d/rspamd? Thanks
 
Hello,

This is one I have:

Code:
/var/log/rspamd/*log {
    daily
    rotate 10
    missingok
    notifempty
    compress
    sharedscripts
    postrotate
        export `systemctl -p MainPID show rspamd.service`; if [ -n "$MainPID" ]; then kill -USR1 $MainPID; fi
    endscript
}

installed with rspamd 3.5-12.
 
Brilliant, that fixed it, thanks a lot! Strange how mine had a different postrotate line. We're on AlmaLinux 8, Rspamd 3.4 installed using custombuild.
 
I'm facing the same issue, AlmaLinux release 8.7 (Stone Smilodon) and rspamd installed using custombuild.

[root@s012 ~]# file /var/run/rspamd.pid
/var/run/rspamd.pid: cannot open `/var/run/rspamd.pid' (No such file or directory)

So this seems like a bug.
 
Back
Top