ondemand icon indicating copy to clipboard operation
ondemand copied to clipboard

logrotate by size

Open johrstrom opened this issue 2 years ago • 2 comments

From discourse - a user is getting a lot of logs filling their directories.

https://discourse.openondemand.org/t/occasional-random-pun-error-log-blowups-with-millions-of-lines-of-websocket-errors/2831

I wonder if it'd be better to enable logrotate by size or not. I seem to recall that we've discussed the same but a search on the issues for logrotate doesn't show anything, so I figured I'd open another ticket.

johrstrom avatar Jul 26 '23 17:07 johrstrom

This is the logrotate file in question.

https://github.com/OSC/ondemand/blob/e2dfdcc1dd5e4376bda17a5bd8f05bdbbd7ebe1d/packaging/files/logrotate

johrstrom avatar Jul 26 '23 17:07 johrstrom

Generally logrotate runs once a day via cron. Sometimes people configure it for hourly. The interval is undefined in the file we distribute and so it relies on the global default which might be daily or might be as long as weekly, which would be usually in /etc/logrotate.conf. Rotating by size won't really matter if the rotation happens once a day, so maybe just forcing the configs to say daily is what's needed? That seems more generic and less likely to result in us having to adjust in future as size can be a moving target in terms of getting the right value.

FWIW this file can be modified by those who install OnDemand and RPM updates won't replace: https://github.com/OSC/ondemand/blob/e2dfdcc1dd5e4376bda17a5bd8f05bdbbd7ebe1d/packaging/rpm/ondemand.spec#L337

treydock avatar Jul 26 '23 21:07 treydock