Hashar has uploaded a new change for review.

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


Change subject: jenkins: logrotate access.log
......................................................................

jenkins: logrotate access.log

Jenkins does not automatically logrotate its access log. One has to rely
on logrotate to do so.  The Debian package provided by upstream does not
include the script so I just copy pasted it and amended the filename to
match our own configuration.

A bug got filled upstream to have the logrotate script included in
Debian package:
https://issues.jenkins-ci.org/browse/JENKINS-18870

Change-Id: Iee3495be6ebf812478da83470053512d1fc0587a
---
A modules/jenkins/files/jenkins_accesslog.logrotate
M modules/jenkins/manifests/init.pp
2 files changed, 28 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/13/75113/1

diff --git a/modules/jenkins/files/jenkins_accesslog.logrotate 
b/modules/jenkins/files/jenkins_accesslog.logrotate
new file mode 100644
index 0000000..97fd61c
--- /dev/null
+++ b/modules/jenkins/files/jenkins_accesslog.logrotate
@@ -0,0 +1,19 @@
+# Logrotate file copied from upstream since it is not shipped
+# by upstream Debian package.
+# https://issues.jenkins-ci.org/browse/JENKINS-18870
+/var/log/jenkins/access.log {
+    compress
+    dateext
+    maxage 365
+    rotate 99
+    size=+4096k
+    notifempty
+    missingok
+    create 644
+    postrotate
+      if [ -s /var/run/jenkins.pid ]; then
+        JPID=`cat /var/run/jenkins.pid`
+        test -n "`find /proc/$JPID -maxdepth 0 -user jenkins 2>/dev/null`" && 
/bin/kill -s ALRM $JPID || :
+      fi
+    endscript
+}
diff --git a/modules/jenkins/manifests/init.pp 
b/modules/jenkins/manifests/init.pp
index b1a851a..8d69ce3 100644
--- a/modules/jenkins/manifests/init.pp
+++ b/modules/jenkins/manifests/init.pp
@@ -50,6 +50,15 @@
     owner  => 'jenkins',
     group  => 'jenkins',
   }
+  # access.log rotation. Not provided by upstream Debian package
+  # https://issues.jenkins-ci.org/browse/JENKINS-18870
+  file { '/etc/logrotate.d/jenkins_accesslog':
+    owner  => 'root',
+    group  => 'root',
+    mode   => '0444',
+    source => 'puppet:///modules/jenkins/jenkins_accesslog.logrotate',
+  }
+
   file { '/etc/default/jenkins':
     owner  => 'root',
     group  => 'root',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee3495be6ebf812478da83470053512d1fc0587a
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