Description of problem: If the logshifter configuration file contains any blank lines "\n" between configuration directives, the directives after the first blank line will be skipped. Version-Release number of selected component (if applicable): - How reproducible: Always Steps to Reproduce: 1. On an OpenShift node, insert a blank line between the first and second directive in /etc/openshift/logshifter.conf 2. Set the outputType directive to the non-default value 'syslog' outputType=syslog 3. Restart all existing gears or create a new one: # oo-admin-ctl-gears restartall Actual results: Gear logs are sent to files in ~/app-root/logs since outputType is undefined and defaults to 'file' Expected results: Gear logs are sent to syslog, as configured. Additional info:
https://github.com/openshift/origin-server/pull/6138
Verified and pass in ose-2.2 puddle 2015-05-18.1 1) Enable syslog for gears and node during installation 2) add blank lines "\n" between configuration directives. 3) create app and Restart all gears [root@node1 ~]# oo-admin-ctl-gears restartall Stopping gear 555d67544add71f05e000006 ... [ OK ] Starting gear 555d67544add71f05e000006 ... [ OK ] Stopping gear 555d67544add71f05e000005 ... [ OK ] Starting gear 555d67544add71f05e000005 ... [ OK ] 3) check the ~/app-root/logs, there isn't log file [root@broker ~]# rhc ssh sphp "ls ~/app-root/logs" 4) check the /var/log/message, the operation are recorded. May 21 13:10:13 node1 openshift-platform[23844]: (23844) Stopping gear 555d67544add71f05e000006 ... [ OK ] May 21 13:10:13 node1 openshift-platform[23844]: (23844) Stopping gear 555d67544add71f05e000006 ... [ OK ] May 21 13:10:34 node1 openshift-platform[23844]: (23844) Starting gear 555d67544add71f05e000006 ... [ OK ] May 21 13:10:34 node1 openshift-platform[23844]: (23844) Starting gear OK ]
I can recreated the problem. However during recreate this bug, I found if outputType is not defined, the default values is syslog, which is different with the origin steps. So I use outputType = multi to verify this bug. With following step, without the fix, the logs only written to openshift_gears; in puddle-2-2-2015-05-21, The logs are written to both app-root/logs/php.log and /var/lib/openshift_gears. so move this bug to verified. My steps is as below: 1) set CONF_SYSLOG="gears" in openshift.sh and install node 2) create php applications 3) insert blank line in logshifter.conf root@node2 ~]# cat /etc/openshift/logshifter.conf queuesize = 1000 inputbuffersize = 4096 outputType = multi syslogbuffersize = 4096 filebuffersize = 4096 outputTypeFromEnviron = true filewriterdir = ~/app-root/logs 4). restart ruby193-mcollective and gears. 5). tailf /var/log/openshift_gears, and tailf /var/livb
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1463.html