packages icon indicating copy to clipboard operation
packages copied to clipboard

syslog-ng: fix OOM issues by adding support for logrotate

Open ynezz opened this issue 2 years ago • 2 comments

Maintainer: @BKPepe Compile tested: glinet-b1300, turris-omnia, 19.07, 22.03 Run tested: glinet-b1300, turris-omnia, 19.07, 22.03

Description:

With heavy system logging which goes by default into /var/log/messages log file which is usually placed in tmpfs/RAM one can trigger OOM killer fairly easily, thus killing random processes and in some cases making system unusable.

This is likely happening due to the fact, that Linux by default uses 1/2 of available RAM for tmpfs, which might be for example an issue on low RAM devices with ath10k wireless.

So let's fix it by adding logrotate functionality which should limit the size of /var/log/messages log file to 1M by default, but could be tweaked by config knob if needed be.

ynezz avatar Aug 10 '22 13:08 ynezz

In Turris OS, we have similar approach as you did.

It's 404 here:

$ curl https://github.com/openwrt/packages/pull/2c617bbe224ab2e6878e86c5cd61dbfa59440500
Not found

And that referenced commit 2c617bbe is likely wrong target as well.

ynezz avatar Aug 22 '22 10:08 ynezz

And that referenced commit 2c617bb is likely wrong target as well.

Oops! My bad. This is the correct link - https://gitlab.nic.cz/turris/os/build/-/blob/5a54ac10f3c4d066848eee472d17e302574a301c/patches/packages/to-upstream/0014-syslog-ng-rotate-default-log-with-logrotate.patch I will edit it in the previous comment.

BKPepe avatar Aug 22 '22 10:08 BKPepe

Thank you for your contribution! :+1:

BKPepe avatar Aug 26 '22 14:08 BKPepe