syslog-ng: fix OOM issues by adding support for logrotate
authorPetr Štetiar <ynezz@true.cz>
Tue, 9 Aug 2022 08:28:43 +0000 (10:28 +0200)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Fri, 26 Aug 2022 14:57:00 +0000 (16:57 +0200)
commit660fa63faf2881d69f903a589568b72fbd4d61f5
tree73698fec069a73d1705b5e2ec0e5d066c4cb1e74
parent72cf350b08c0a774a8491e3f1d35915a4d99e6a5
syslog-ng: fix OOM issues by adding support for logrotate

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.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
admin/syslog-ng/Makefile
admin/syslog-ng/files/syslog-ng.logrotate [new file with mode: 0644]