Bug 803039 - rhq-agent-wrapper.sh doesn't work on RHEL 5.4
Summary: rhq-agent-wrapper.sh doesn't work on RHEL 5.4
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Launch Scripts
Version: 4.3
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
Depends On:
TreeView+ depends on / blocked
Reported: 2012-03-13 19:54 UTC by Elias Ross
Modified: 2014-04-15 21:18 UTC (History)
1 user (show)

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

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1088032 None None None Never

Internal Links: 1088032

Description Elias Ross 2012-03-13 19:54:12 UTC
Description of problem:

Wrapper script assumes all Linux releases support -e for readlink.

So if you link /etc/init.d/rhq-agent to a different location, the wrapper won't find the home directory.

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

$ cat /etc/redhat-release 
Red Hat Enterprise Linux AS release 4 (Nahant Update 8)

How reproducible: Always

Steps to Reproduce:
1. Install agent on RHEL 5.4 machine
2. Link from /etc/init.d/rhq-agent to /usr/local/rhq-agent
3. Attempt to start agent from /etc/init.d
Actual results:

$ /etc/init.d/rhq-agent stop
rhq-agent-wrapper.sh: RHQ_AGENT_WRAPPER_BIN_DIR_PATH=/etc/init.d
rhq-agent-wrapper.sh: pidfile will be located at /etc/bin/rhq-agent.pid
RHQ Agent (no pidfile) is NOT running

Additional info:

-e introduced in RHEL 5.5

Unclear -e is really needed, -f is probably OK.


@@ -117,9 +117,10 @@ esac
 # 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"
+# -e option not supported on RHEL 5.4
+# if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then
+   # _READLINK_ARG="-e"
+# fi

Comment 1 Elias Ross 2012-03-13 20:16:16 UTC
I'm not suggesting that patch is any good, but it's what I did to make it work.

Maybe you can do 'readlink -e' and if that fails 'readlink -f' and then give up?

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