Bug 535803 (RHQ-2461)

Summary: Improvement in rhq-agent-wrapper.sh to be able to use on all linux distributions
Product: [Other] RHQ Project Reporter: Darko Palic <darko.palic>
Component: Launch ScriptsAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: darko.palic
Target Milestone: ---Keywords: Improvement
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-2461
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Tested on Ubuntu 9.04, 8.04, 8.10
Last Closed: Type: ---
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
rhq-agent-wrapper.patched none

Description Darko Palic 2009-10-11 17:44:00 UTC
The current rhq-agent-wrapper.sh script is not capable to be used directly as a startup script. The lookup of the scriptname with readlink "readlink isn't recursive.
The error can be reproduced by creating a link from /etc/init.d/rhq-agent -> mypathToTheScript
And if you now add the /etc/init.d/rhq-agent into the rcX.d folder with the typical symlink the startup will fail

rhq-agent-wrapper.sh should be changed from 
_DOLLARZERO=`readlink "$0" || echo "$0"`

to 
_DOLLARZERO=`readlink -f "$0" || echo "$0"`

The -f forces that all symlinks get recusivly resolved until a proper file is reached.

Comment 1 Darko Palic 2009-10-11 17:46:02 UTC
Here the patch for the wrapper script

Sorry found this related issue to late:
RHQ-2444

Comment 2 Red Hat Bugzilla 2009-11-10 21:04:53 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2461
Imported an attachment (id=368801)
This bug duplicates RHQ-2444