Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1358422 - LD_LIBRARY_PATH entries exported in unix session are overriden in apachectl script
Summary: LD_LIBRARY_PATH entries exported in unix session are overriden in apachectl s...
Keywords:
Status: MODIFIED
Alias: None
Product: JBoss Enterprise Web Server 2
Classification: JBoss
Component: httpd
Version: 2.1.1
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: CR02
: 2.1.1
Assignee: Coty Sutherland
QA Contact: Jan Stefl
URL:
Whiteboard:
Depends On:
Blocks: 1363639
TreeView+ depends on / blocked
 
Reported: 2016-07-20 16:01 UTC by fgoldefu
Modified: 2018-03-06 20:58 UTC (History)
4 users (show)

Doc Type: Bug Fix
Doc Text:
When LD_LIBRARY_PATH content was overwritten by apachectl, you could not set it before starting apachectl. This is fixed. The part needed by apachectl is added before the environment variable value.
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
JBoss Issue Tracker JBCS-65 Critical Closed LD_LIBRARY_PATH entries exported in unix session are overriden in apachectl script 2017-11-09 19:25:47 UTC

Description fgoldefu 2016-07-20 16:01:11 UTC
Description of problem:
LD_LIBRARY_PATH entries exported in unix session are overridden in apachectl script.

Version-Release number of selected component (if applicable):
EWS 2.1.1

How reproducible:
Every time.

Steps to Reproduce:
1. Set LD_LIBRARY_PATH in a shell
2. Use apachectl to start/stop/etc
3. Observe that your LD_LIBRARY_PATH was overridden by the apachectl version.

Actual results:
apachectl overwrites LD_LIBRARY_PATH

Expected results:
apachectl shouldn't overwrite LD_LIBRARY_PATH

Comment 2 Bogdan Sikora 2016-08-01 06:32:50 UTC
Change to "export LD_LIBRARY_PATH="$currentDir/lib:$LD_LIBRARY_PATH"" in postinstall is not correct as it will result to "export LD_LIBRARY_PATH="/opt/jboss-ews-2.1/httpd/lib:"" you need to escape it in postinstall

Comment 5 Bogdan Sikora 2016-08-08 06:35:54 UTC
it makes sense ;) It's part of postinstall script that changes apachectl, if $ is not escaped, LD_LIBRARY_PATH will be resolved to it's actual value when postinstall is run. One want to set LD_LIBRARY_PATH when starting apache httpd server, and not postinstall, i suppose...

Comment 6 Jean-frederic Clere 2016-08-08 14:05:01 UTC
So probably the $currentDir needs to be escaped too no?

Comment 7 Coty Sutherland 2016-08-08 14:22:30 UTC
(In reply to Jean-frederic Clere from comment #6)
> So probably the $currentDir needs to be escaped too no?

No, if we do that the apachectl will always export ":" because it can't evaluate the $currentDir variable at runtime. The postinstall script is a script executed to create another script (for this portion); it updates the LD_LIBRARY_PATH location in apachectl. If we don't escape the variable, you get the following in apachectl after running postinstall:

$ grep LD_LIBRARY_PATH sbin/apachectl 
export LD_LIBRARY_PATH="~/jboss-ews-2.1/httpd/lib:"

Obviously, that's wrong. What we really want is:

$ grep LD_LIBRARY_PATH sbin/apachectl 
export LD_LIBRARY_PATH="~/jboss-ews-2.1/httpd/lib:$LD_LIBRARY_PATH"

so that the variable gets evaluated every time the user executes apachectl, not when the postinstall script is executed.

Comment 8 JBoss JIRA Server 2016-08-25 11:05:01 UTC
Michal Karm Babacek <mbabacek@redhat.com> updated the status of jira JBCS-65 to Resolved

Comment 9 JBoss JIRA Server 2016-09-21 11:37:03 UTC
Bogdan Sikora <bsikora@redhat.com> updated the status of jira JBCS-65 to Reopened

Comment 10 JBoss JIRA Server 2016-09-21 16:08:16 UTC
Coty Sutherland <csutherl@redhat.com> updated the status of jira JBCS-65 to Resolved


Note You need to log in before you can comment on or make changes to this bug.