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

automatically rotate rspamd.log on freebsd #403

Closed
msimerson opened this issue Oct 17, 2015 · 6 comments
Closed

automatically rotate rspamd.log on freebsd #403

msimerson opened this issue Oct 17, 2015 · 6 comments

Comments

@msimerson
Copy link
Contributor

by doing something like this:

echo '/var/log/rspamd/rspamd.log    nobody:nobody   644  5     100  @0101T JC /var/run/rspamd/rspamd.pid' > /usr/local/etc/newsyslog.conf.d/rspamd

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@moisseev
Copy link
Member

I had issues with SIGHUP. #97 So I am using SIGUSR1 (30) for log rotation.

I suppose 100K size limit is too low. With level = "info"; I have about 1M logs per day on very small servers.

I'd like something like this:
/var/log/rspamd/rspamd.log nobody:nobody 644 7 * @T00 J /var/run/rspamd/rspamd.pid 30
or
/var/log/rspamd/rspamd.log nobody:nobody 644 7 5000 $W0D0 J /var/run/rspamd/rspamd.pid 30

@msimerson
Copy link
Contributor Author

/var/log/rspamd/rspamd.log nobody:nobody 644 7 * @t00 J /var/run/rspamd/rspamd.pid 30

That's fine by me. It has the added advantage of being nice and predictable.

@msimerson
Copy link
Contributor Author

Actually, I amend that to:

- /var/log/rspamd/rspamd.log nobody:nobody 644 7 * @T00 J /var/run/rspamd/rspamd.pid 30
+ /var/log/rspamd/rspamd.log nobody:nobody 644 7 * @T00 JC /var/run/rspamd/rspamd.pid 30

The rolled log files should be compressed.

@moisseev
Copy link
Member

moisseev commented Nov 2, 2015

I have no objection, I'm just wondering what benefits of using C flag here? Rspamd itself creates log file if it doesn't exist.

@msimerson
Copy link
Contributor Author

As long as /var/log/rspamd/ exists and is writable by nobody:nobody, so that rspamd has permission to create the new file, then there's no difference at all. On occasion, rude things can occur in /var/logs (think: disk full events, aggressive/inadvertent rm -rf, etc.) and newsyslog, running as root, has the ability to 'set things right'. If you aren't going to use the C flags there, then it's rather pointless to specify the user:group, don'tcha think?

@moisseev
Copy link
Member

@vstakhov could you commit Bug 205456 for mail/rspamd-devel too?

rm-minus-rf pushed a commit to rm-minus-rf/rspamd that referenced this issue Apr 21, 2020
metadata_exporter: document some undocumented controls
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

No branches or pull requests

3 participants