See this:
http://svn.rhq-project.org/repos/rhq/trunk/modules/enterprise/agent/src/etc/rhq-agent.sh
We've even taken into account the use-case where the script is actually a softlink.
_DOLLARZERO=`readlink "$0" || echo "$0"` RHQ_AGENT_BIN_DIR_PATH=`dirname "$_DOLLARZERO"` if [ -f "${RHQ_AGENT_BIN_DIR_PATH}/rhq-agent-env.sh" ]; then debug_msg "Loading environment script: ${RHQ_AGENT_BIN_DIR_PATH}/rhq-agent-env.sh" . "${RHQ_AGENT_BIN_DIR_PATH}/rhq-agent-env.sh" $* else debug_msg "No environment script found at: ${RHQ_AGENT_BIN_DIR_PATH}/rhq-agent-env.sh" fi
Ok, maybe that change just didn't make it to 2.1.0.GA which is the version that I'm running. It seems to be the production version linked to from https://www.jboss.org/community/docs/DOC-12805.