ArielGlenn has submitted this change and it was merged.

Change subject: jobrunner: refactor rsyslog conf and let wikidev read log
......................................................................


jobrunner: refactor rsyslog conf and let wikidev read log

rsyslog creates files that are only readable by root:adm which is rather
annoying for people trying to find out why jobs are failling.

Introduce an rsyslog template to vary the log file name based on the
programname we are interested in.
Catch both 'jobrunner' and 'jobchron' programs.
Have the file to be owned by root:wikidev mode 0640 so wikidev folks can
read the logs (bug T146040).
'& ~' is magic to prevent the message to also end up in /var/log/syslog

Later we will want to send them to logstash.

Bug: T146040
Change-Id: I04955407372472cbd9b4424aebf6c30e0e00e60a
---
M modules/mediawiki/files/jobrunner.rsyslog.conf
1 file changed, 7 insertions(+), 3 deletions(-)

Approvals:
  ArielGlenn: Looks good to me, approved
  Hashar: Looks good to me, but someone else must approve
  jenkins-bot: Verified

Objections:
  Giuseppe Lavagetto: There's a problem with this change, please improve



diff --git a/modules/mediawiki/files/jobrunner.rsyslog.conf 
b/modules/mediawiki/files/jobrunner.rsyslog.conf
index 62e330c..e078436 100644
--- a/modules/mediawiki/files/jobrunner.rsyslog.conf
+++ b/modules/mediawiki/files/jobrunner.rsyslog.conf
@@ -1,4 +1,8 @@
-# rsyslogd(8) configuration file for HHVM.
+# rsyslogd(8) configuration file for the jobrunner services
 # This file is managed by Puppet.
-:programname, startswith, "jobrunner" /var/log/mediawiki/jobrunner.log
-:programname, startswith, "jobchron" /var/log/mediawiki/jobchron.log
+template(name="jobservice_logfile" type="string" 
string="/var/log/mediawiki/%programname%.log")
+
+if ($programname == 'jobrunner') or ($programname == 'jobchron') then {
+    action(type="omfile" dynaFile="jobservice_logfile" FileCreateMode="0640" 
FileOwner="root" FileGroup="wikidev")
+    & ~
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I04955407372472cbd9b4424aebf6c30e0e00e60a
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Alex Monk <a...@wikimedia.org>
Gerrit-Reviewer: ArielGlenn <ar...@wikimedia.org>
Gerrit-Reviewer: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Hashar <has...@free.fr>
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