Bug 741064 - rhq-agent-wrapper.sh doesn't works when referenced by symlink on RHEL 4
Summary: rhq-agent-wrapper.sh doesn't works when referenced by symlink on RHEL 4
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Launch Scripts
Version: 4.1
Hardware: x86_64
OS: Linux
low
medium vote
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-24 19:47 UTC by Rafael Soares (Tuelho)
Modified: 2011-09-28 14:44 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Rafael Soares (Tuelho) 2011-09-24 19:47:52 UTC
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-28 01:23:31 UTC
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.