Please don't hijack threads. Post a new topic as an original post, not as a reply to an old thread.
On 5/2/23 15:45, Christian via Mailman-users wrote:
I noticed that my mailman logfiles are not being rotated. I followed the instructions in https://mail.python.org/archives/list/mailman-developers@python.org/message/ FM3TSMQ63JR2KROJGOSPENODOOQVRYCL/
Those instructions are for Mailman 2.1.
Now when I try and run logrotate I get the following error
root@zarathustra:/opt/mailman/mm/logs# logrotate /etc/logrotate.conf error: stat of /opt/mailman/mm/logs/bounce.log failed: No such file or directory error: stat of /opt/mailman/mm/error.log failed: No such file or directory error: stat of /opt/mailman/mm/mailman.log failed: No such file or directory error: stat of /opt/mailman/mm/mailmansuite.log failed: No such file or directory error: stat of /opt/mailman/mm/smtp.log failed: No such file or directory root@zarathustra:
What am I doing wrong please?
Here's a logrotate script I use:
/opt/mailman/mm/var/logs/*.log {
missingok
sharedscripts
su mailman mailman
postrotate
sudo -u mailman /opt/mailman/mm/bin/mailman reopen &>/dev/null
|| true
if [ -r /opt/mailman/mm/var/gunicorn.pid ]; then
PID=`cat /opt/mailman/mm/var/gunicorn.pid`
kill -s USR1 $PID
fi
endscript
}
A couple of caveats. The first line of the postrotate script may be
wrapped. sudo ... true
is all one line.
That line could also be
/opt/mailman/mm/bin/mailman --run-as-root reopen &>/dev/null || true
I.e., it either has to run as the mailman user or specify the --run-as-root option.
Also, if logs aren't in /opt/mailman/mm/var/logs/ or gunicorn.pid isn't in /opt/mailman/mm/var/ those paths need adjusting.
Finally, there may be an issue with mailman reopen
in the postrotate
scrupt. See https://gitlab.com/mailman/mailman/-/issues/1078
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan