Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/164520

Change subject: labs: reduce acct archiving retention
......................................................................

labs: reduce acct archiving retention

In our standard packages we install 'acct' which does user and process
accounting (see commands 'ac' and 'lastcomm').  The log are held in
/var/log/account which, on labs is a 2GB partition that ends up filling
quite rapidly on busy instances.

On the beta cluster deployment-bastion instance, it takes up to 500MB or
a quarter of the /var instance.  Reading the SAL I noticed we keep
cleaning up manually to reclaim disk space.

The files are rotated via a daily cron using the 'savelog' command. It
is passed $ACCT_LOGGING which default to 30 days.  Reduce it on all labs
instance to 12 days.  On deployment-bastion that would save up roughly
360MB.

Bug: 69604
Change-Id: Iae6adb6e5783e6ddbcba11779d204aff8e76f9b9
---
M manifests/role/labs.pp
A modules/base/files/labs-acct.default
2 files changed, 26 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/20/164520/1

diff --git a/manifests/role/labs.pp b/manifests/role/labs.pp
index 7356b51..b1dd4d3 100644
--- a/manifests/role/labs.pp
+++ b/manifests/role/labs.pp
@@ -141,6 +141,16 @@
         source => 'puppet:///files/nfs/idmapd.conf',
     }
 
+    # Labs instances /var is quite small, provide our own default
+    # to keep less records (bug 69604).
+    file { '/etc/default/acct':
+        ensure => present,
+        owner  => 'root',
+        group  => 'root',
+        mode   => '0444',
+        source => 'puppet:///modules/base/labs-acct.default',
+    }
+
     # In production, we try to be punctilious about having Puppet manage
     # system state, and thus it's reasonable to purge Apache site configs
     # that have not been declared via Puppet. But on Labs we want to allow
diff --git a/modules/base/files/labs-acct.default 
b/modules/base/files/labs-acct.default
new file mode 100644
index 0000000..5c37ce5
--- /dev/null
+++ b/modules/base/files/labs-acct.default
@@ -0,0 +1,16 @@
+#####################################################################
+### THIS FILE IS MANAGED BY PUPPET
+### puppet:///modules/base/labs-acct.default
+#####################################################################
+
+# Defaults for acct
+
+# If you want to keep acct installed, but not started automatically, set this
+# variable to 0. Because /etc/cron.daily/acct calls the initscript daily, it is
+# not sufficient to stop acct once after booting if your machine remains up.
+ACCT_ENABLE="1"
+
+# Amount of days that the logs are kept.
+#ACCT_LOGGING="30"
+# Labs instances /var is quite small, keep less records (bug 69604).
+ACCT_LOGGING="12"

-- 
To view, visit https://gerrit.wikimedia.org/r/164520
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae6adb6e5783e6ddbcba11779d204aff8e76f9b9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to