Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete duplicate logrotate config for mail.log #214

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

sushain97
Copy link
Contributor

@sushain97 sushain97 commented Oct 1, 2024

Fixes #212. This appears to be a common strategy: https://github.com/docker-mailserver/docker-mailserver/blob/c29fe3ff0bc888016720536228878b3f19131056/Dockerfile#L259.

Before

root@postfix-mail-0:/tmp# /etc/cron.daily/logrotate
error: rsyslog:1 duplicate log entry for /var/log/mail.log
error: found error in file rsyslog, skipping
root@postfix-mail-0:/tmp# echo $?
1
root@postfix-mail-0:/tmp# cat /etc/logrotate.d/logrotate.conf
/var/log/mail.log {
    copytruncate
    rotate 1
    monthly
    minsize 1M
    compress
    missingok
    notifempty
    dateext
    olddir /var/log/
    maxage 90
}

After

root@postfix-mail-0:/tmp# if egrep -q '^/var/log/mail.log' /etc/logrotate.d/logrotate.conf; then
        echo "Removing /var/log/mail.log from /etc/logrotate.d/rsyslog"
        sed -i -E '/^\/var\/log\/mail.log/d' /etc/logrotate.d/rsyslog
fi
Removing /var/log/mail.log from /etc/logrotate.d/rsyslog
root@postfix-mail-0:/tmp# /etc/cron.daily/logrotate
root@postfix-mail-0:/tmp# echo $?
0
root@postfix-mail-0:/tmp# cat /etc/logrotate.d/rsyslog
/var/log/syslog
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/cron.log
{
        rotate 4
        weekly
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        postrotate
                /usr/lib/rsyslog/rsyslog-rotate
        endscript
}

@bokysan
Copy link
Owner

bokysan commented Oct 1, 2024

Looks good!

All tests pass? I will go over it tonight.

B

@sushain97
Copy link
Contributor Author

@bokysan gentle bump on this

@sushain97 sushain97 mentioned this pull request Oct 12, 2024
@bokysan
Copy link
Owner

bokysan commented Oct 17, 2024

I'll merge this to master and test it out. If it works, I will push out a new version soon.

@bokysan bokysan merged commit 994d4ae into bokysan:master Oct 17, 2024
5 checks passed
@sushain97
Copy link
Contributor Author

@bokysan thanks!

@sushain97
Copy link
Contributor Author

@bokysan Any word on a new version?

@sushain97
Copy link
Contributor Author

@bokysan just checking in - could this be released?

@bokysan
Copy link
Owner

bokysan commented Nov 13, 2024

In a couple of days. Traveling ATM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logrotate cron failing
2 participants