From: Stephen Soltesz Date: Fri, 1 Apr 2011 21:16:38 +0000 (-0400) Subject: Add an entry for /etc/logrotate.d/btmp to rotate the /var/log/btmp file, which X-Git-Tag: 5.0-rc23~97^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=e9f99808ead0c9c48b776811d27a18b3a0170144;hp=88fe51bec04a5202be62816a143e2462babeed2d;p=build.git Add an entry for /etc/logrotate.d/btmp to rotate the /var/log/btmp file, which can grow unbounded from failed ssh logins and fill the root fs of a node. --- diff --git a/config.planetlab/bootstrapfs.post b/config.planetlab/bootstrapfs.post index 9ceb582f..79d54fe3 100644 --- a/config.planetlab/bootstrapfs.post +++ b/config.planetlab/bootstrapfs.post @@ -52,6 +52,19 @@ if echo ${vdir} | grep -q x86_64 ; then chroot ${vdir} rpm -qa --qf '%{name}.%{arch}\n' | grep 'i[36]86$' | xargs chroot ${vdir} rpm -e fi +# Add a logrotate script for btmp, which logs failed ssh logins, which can +# grow unbounded on public plnodes and fill the root fs. +cat < ${vdir}/etc/logrotate.d/btmp +/var/log/btmp { + weekly + minsize 1M + create 0600 root utmp + rotate 2 + compress + notifempty +} +EOF + # NOTE: This is added to relieve one site's Cisco router configuration that # fails to recognize the host once the arping is sent out. # NOTE: this is pretty fragile, and fails on fedora 10 that as of today (oct. 20 2009)