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: CLOSED WONTFIX
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: 2019-06-13 12:22 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-06-13 12:22:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBCS-65 0 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> updated the status of jira JBCS-65 to Resolved

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

Comment 10 JBoss JIRA Server 2016-09-21 16:08:16 UTC
Coty Sutherland <csutherl> 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.