forked from coolsnowwolf/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
bfc58b0
commit 9ed7690
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/var/log/messages { | ||
compress | ||
copytruncate | ||
delaycompress | ||
notifempty | ||
maxsize @MAXSIZE@ | ||
missingok | ||
postrotate | ||
/usr/sbin/syslog-ng-ctl reload > /dev/null | ||
endscript | ||
rotate @ROTATE@ | ||
} |