Bug 1153373

Summary: RHQ fails to do dev startup after new install on Mac OS/X
Product: [Other] RHQ Project Reporter: Mike Thompson <mithomps>
Component: InstallerAssignee: Nobody <nobody>
Status: ON_QA --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.12CC: hrupp, mazz
Target Milestone: ---   
Target Release: RHQ 4.13   
Hardware: Unspecified   
OS: Mac OS   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Bug Depends On:    
Bug Blocks: 1095508    

Description Mike Thompson 2014-10-15 21:44:08 UTC
Description of problem:
Plain install/start fails to find the rhq-agent.sh on './rhqctl start'

No special options or anything like that.

NOTE: this has happened to a couple devs on macs not just one.


Version-Release number of selected component (if applicable):
Current master.


How reproducible:
Always

Steps to Reproduce:
1. ./rhqctrl install
2. ./rhqctrl start


Actual results:
Starting RHQ Agent...
ERROR! Cannot find the RHQ Agent start script
Not found: ./bin/rhq-agent.sh

NOTE: there is an extra bin directory in the rhq-agent/bin directory

Expected results:
It should start up like normal.


Additional info:
It appears  that commit: https://github.com/rhq-project/rhq/compare/3a5701178868...806230cd33d4
 
is the offender as the previous commit: ac288754cd94d566d97c5d2d12a239f4bc7b137a works fine.

Comment 1 Mike Thompson 2014-10-21 01:47:28 UTC
This regression disables startup on OS/X. For dev builds, one is unable to start up RHQ on Mac OS/X; making development a no-go on OS/X.

Comment 2 Mike Thompson 2014-10-21 01:54:33 UTC
Checked into master:

commit 04fd1353f62fc38839d82e229de8485a08b048cc
Author: Mike Thompson <mithomps>
Date:   Mon Oct 20 18:42:44 2014 -0700

    [BZ 1153373] RHQ fails to do dev startup after new install on Mac OS/X .
    I fixed the rhq-agent* scripts as these are the minimal changes to make a rhq install work on OS/X. Any more changes represent risk, especially at this late stage in JON release.

The core issue here is that OS/X implementation of readlink does not support any of the standard options such as '-e' or '-f', effectively rendering it useless for the intended purpose. The following Stack Overflow article details the solution: https://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in?lq=1.

Comment 3 Stefan Negrea 2014-10-21 16:01:40 UTC
The tools work properly on Linux after the changes noted above, so the fix targets the right system.I am +1 on the change. 

Also, I updated the target for this change to be RHQ 4.13. This change is only needed for the RHQ community release and should not be backported to JON at this time.

Comment 4 John Mazzitelli 2014-10-21 20:38:21 UTC
It was asked that we cherry pick this to the jon 3.3. branch as well:

commit 284763ea9a388f443dabb2a57171eee2a92eee44
Author: Mike Thompson <mithomps>
Date:   Mon Oct 20 18:42:44 2014 -0700

    [BZ 1153373] RHQ fails to do dev startup after new install on Mac OS/X .
    I fixed the rhq-agent* scripts as these are the minimal changes to make a rhq install work. Any mo
    (cherry picked from commit 04fd1353f62fc38839d82e229de8485a08b048cc)
    
    Signed-off-by: John Mazzitelli <mazz>