Bug 741064 - rhq-agent-wrapper.sh doesn't works when referenced by symlink on RHEL 4
rhq-agent-wrapper.sh doesn't works when referenced by symlink on RHEL 4
Status: NEW
Product: RHQ Project
Classification: Other
Component: Launch Scripts (Show other bugs)
4.1
x86_64 Linux
low Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-24 15:47 EDT by Rafael Soares (Tuelho)
Modified: 2011-09-28 10:44 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rafael Soares (Tuelho) 2011-09-24 15:47:52 EDT
Description of problem:
rhq-agent-wrapper.sh doesn't works when referenced by a symlink on RHEL 4.x OS.

Version-Release number of selected component (if applicable):
tested on versions 3.x and 4.x

How reproducible:
Create a symlink in /etc/init.d/ pointing to RHQ_AGENT_HOME/bin/rhq-agent-wrapper.sh on a RHEL 4.x OS box.

Steps to Reproduce:
1. Try to start the agent using the symlink (eg. /etc/init.d/rhq-agent)
2. 
3.
  
Actual results:
The agent wont start correctly.


Expected results:
Agent statup ok.

Additional info:

I think the problem occurs due the use of '-e' parameter of readlink command in this part of wrapper script:

"
...
# -------------------------------
# Get the location of this script.
# Make sure we take into account the possibility $0
# is a symlink to the real agent installation script.
# Only certain platforms support the -e option of readlink

if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then
   _READLINK_ARG="-e"
fi

_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null|| echo "$0"`
RHQ_AGENT_WRAPPER_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
...
"

As the comment says (# Only certain platforms support the -e option of readlink...), RHEL 4 is one of the OS doesn't supports it.

IMO the '-e' flag is not necessary, at least, when running on Linux OS.
Comment 1 Charles Crouch 2011-09-27 21:23:31 EDT
Here is the bug which added the -e flag
https://bugzilla.redhat.com/show_bug.cgi?id=535784

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