Bug 803039 - rhq-agent-wrapper.sh doesn't work on RHEL 5.4
rhq-agent-wrapper.sh doesn't work on RHEL 5.4
Status: NEW
Product: RHQ Project
Classification: Other
Component: Launch Scripts (Show other bugs)
4.3
Unspecified Unspecified
medium Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-13 15:54 EDT by Elias Ross
Modified: 2014-04-15 17:18 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:


Attachments (Terms of Use)

  None (edit)
Description Elias Ross 2012-03-13 15:54:12 EDT
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.


Patch

@@ -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"
-fi
+# -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 16:16:16 EDT
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.