diff options
author | Daniel Drake <dsd@laptop.org> | 2012-04-13 17:52:24 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2012-04-13 17:56:14 (GMT) |
commit | 28413456e831cacfa285154aa95f3b91746e001c (patch) | |
tree | 66975d95f5a6e6f8c411be8b63615ab25ec793ff | |
parent | d25791bf79b46fa61fc65fc2f26d771228e44315 (diff) |
base: call olpc-logrotate when /var/log/messages hits 1mb (#10075)
Avoid /var/log/messages becoming excessively big and filling the
/var/log tmpfs by rotating the log file once it hits 1mb.
olpc-logrotate (in olpc-utils) will move messages to messages.1 when
this happens, therefore limiting the total log size that can be used
to 2mb.
-rw-r--r-- | modules/base/kspost.10.core.inc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/base/kspost.10.core.inc b/modules/base/kspost.10.core.inc index 2c2978d..2584362 100644 --- a/modules/base/kspost.10.core.inc +++ b/modules/base/kspost.10.core.inc @@ -214,3 +214,8 @@ ln -s /dev/null /etc/systemd/system/plymouth-start.service sed -i -e 's/plymouthd --mode=shutdown/plymouthd --mode=shutdown --kernel-command-line=rhgb/g' /lib/systemd/system/plymouth-poweroff.service sed -i -e 's/plymouthd --mode=shutdown/plymouthd --mode=shutdown --kernel-command-line=rhgb/g' /lib/systemd/system/plymouth-halt.service sed -i -e 's/plymouthd --mode=shutdown/plymouthd --mode=shutdown --kernel-command-line=rhgb/g' /lib/systemd/system/plymouth-reboot.service + +# call olpc-logrotate when log file hits 1mb (#10075) +sed -i -e 's,/var/log/messages,:omfile:$messages,' \ + -e '/$messages/ i$outchannel messages,/var/log/messages,1048576,/usr/sbin/olpc-logrotate' \ + /etc/rsyslog.conf |