Bug 1177821

Summary: Init script: Does not export sysconfig environment variables before starting daemon
Product: Red Hat Enterprise Linux 6 Reporter: John Ruemker <jruemker>
Component: pacemakerAssignee: Andrew Beekhof <abeekhof>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.6CC: abeekhof, cfeist, cluster-maint, cluster-qe, djansa, dvossel, jkortus, kgaillot, salmy, tlavigne
Target Milestone: rcKeywords: EasyFix, Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pacemaker-1.1.12-8.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 07:43:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Export environment variables from sysconfig before starting daemon none

Description John Ruemker 2014-12-30 16:59:23 UTC
Description of problem: Any variables modified in /etc/sysconfig/pacemaker have no effect because the init script that reads this file does not subsequently export those variables before starting the daemon.  So, if you were to say enable a PCMK_debugfile, it will not be used.  In RHEL 7 this is handled for us automagically by systemd via the service unit file's 

  EnvironmentFile=-/etc/sysconfig/pacemaker

but in RHEL 6, our init script takes care of setting everything up, and so it needs to ensure that the daemon will be able to read the configured variables from the environment.  



Version-Release number of selected component (if applicable): pacemaker-1.1.12-4.el6


How reproducible: Always


Steps to Reproduce:
1. Configure PCMK_debugfile=/var/log/pacemaker1.log in /etc/sysconfig/pacemaker
2. Start pacemaker
3. Check whether /var/log/pacemaker1.log was created and is being logged to

Actual results: File is not created and logging goes to default location


Expected results: Settings from /etc/sysconfig/pacemaker are honored


Additional info:

Comment 1 John Ruemker 2014-12-30 17:03:21 UTC
Created attachment 974504 [details]
Export environment variables from sysconfig before starting daemon

Comment 2 Andrew Beekhof 2015-01-05 02:48:45 UTC
First line of /etc/sysconfig/pacemaker:

# For non-systemd based systems, prefix export to each enabled line

I like the patch though, even nicer :-)

Comment 3 John Ruemker 2015-01-05 15:08:00 UTC
D'oh! Looked right past that.  Thanks for pointing it out.

Comment 5 Andrew Beekhof 2015-03-01 20:40:35 UTC
No capacity for 6.7, acking for 6.8

Comment 8 Andrew Beekhof 2015-05-06 22:43:19 UTC
QE ack please (since you created the patch I'm assuming you know how to test :)

Comment 12 errata-xmlrpc 2015-07-22 07:43:56 UTC
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/RHSA-2015-1424.html

Comment 13 Ken Gaillot 2016-02-26 21:44:00 UTC
FYI The pacemaker_remote init script is affected by this, too. Fixed upstream as of 60bf228. It may be too late to get that one into 6.8.

Comment 14 Ken Gaillot 2016-09-26 22:08:46 UTC
(In reply to Ken Gaillot from comment #13)
> FYI The pacemaker_remote init script is affected by this, too. Fixed
> upstream as of 60bf228. It may be too late to get that one into 6.8.

FYI, the pacemaker_remote equivalent did not make it into 6.8, but will be included in 6.9 via the rebase for Bug 1356727.