Ema has submitted this change and it was merged.

Change subject: update-ocsp-all: write output to logfile
......................................................................


update-ocsp-all: write output to logfile

Use a logfile (and rotate it) instead of cronspamming.

Bug: T132835
Bug: T132324
Change-Id: Id4a73844d6218a0e257191690feec898f48db371
---
A modules/sslcert/files/update-ocsp-all-logrotate
A modules/sslcert/files/update-ocsp-all.rsyslog.conf
M modules/sslcert/manifests/ocsp/init.pp
3 files changed, 20 insertions(+), 1 deletion(-)

Approvals:
  Ema: Verified; Looks good to me, approved
  BBlack: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/sslcert/files/update-ocsp-all-logrotate 
b/modules/sslcert/files/update-ocsp-all-logrotate
new file mode 100644
index 0000000..5807eb9
--- /dev/null
+++ b/modules/sslcert/files/update-ocsp-all-logrotate
@@ -0,0 +1,6 @@
+/var/log/update-ocsp-all.log {
+    rotate 7
+    daily
+    compress
+    missingok
+}
diff --git a/modules/sslcert/files/update-ocsp-all.rsyslog.conf 
b/modules/sslcert/files/update-ocsp-all.rsyslog.conf
new file mode 100644
index 0000000..db3c471
--- /dev/null
+++ b/modules/sslcert/files/update-ocsp-all.rsyslog.conf
@@ -0,0 +1,3 @@
+# NOTE: This file is managed by Puppet.
+
+if $programname == 'update-ocsp-all' then /var/log/update-ocsp-all.log
diff --git a/modules/sslcert/manifests/ocsp/init.pp 
b/modules/sslcert/manifests/ocsp/init.pp
index aada7e4..26ca9ab 100644
--- a/modules/sslcert/manifests/ocsp/init.pp
+++ b/modules/sslcert/manifests/ocsp/init.pp
@@ -50,7 +50,7 @@
     }
 
     cron { 'update-ocsp-all':
-        command => '/usr/local/sbin/update-ocsp-all',
+        command => '/usr/local/sbin/update-ocsp-all 2>&1 | logger -t 
update-ocsp-all',
         minute  => fqdn_rand(60, '1adf3dd699e51805'),
         hour    => '*',
         require => [
@@ -58,4 +58,14 @@
             File['/etc/update-ocsp.d'],
         ],
     }
+
+    rsyslog::conf { 'update-ocsp-all':
+        source   => 'puppet:///modules/sslcert/update-ocsp-all.rsyslog.conf',
+    }
+
+    # Rotate /var/log/update-ocsp-all.log
+    logrotate::conf { 'update-ocsp-all':
+        ensure => present,
+        source => 'puppet:///modules/sslcert/update-ocsp-all-logrotate',
+    }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id4a73844d6218a0e257191690feec898f48db371
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ema <e...@wikimedia.org>
Gerrit-Reviewer: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Ema <e...@wikimedia.org>
Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to