Add an entry for /etc/logrotate.d/btmp to rotate the /var/log/btmp file, which
authorStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 1 Apr 2011 21:16:38 +0000 (17:16 -0400)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Fri, 1 Apr 2011 21:16:38 +0000 (17:16 -0400)
can grow unbounded from failed ssh logins and fill the root fs of a node.

config.planetlab/bootstrapfs.post

index 9ceb582..79d54fe 100644 (file)
@@ -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 <<EOF > ${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)