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
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Launch Scripts
Version: 4.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-13 19:54 UTC by Elias Ross
Modified: 2022-03-31 04:27 UTC (History)
1 user (show)

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


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1088032 0 unspecified CLOSED Linux/Unix shell scripts attempt to use readlink even if it isn't installed/exist causing "readlink: not found" to be di... 2021-02-22 00:41:40 UTC

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.


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 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.