Bug 973782

Summary: Agent startup script fails at reboot
Product: [Other] RHQ Project Reporter: Elias Ross <genman>
Component: AgentAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.5CC: genman, hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Elias Ross 2013-06-12 17:47:04 UTC
/etc/rc3.d/S93rhq-agent: line 160: cd: ../init.d: No such file or directory
Starting RHQ Agent...
ERROR! Cannot find the RHQ Agent start script
Not found: //bin/rhq-agent.sh

-bash-4.1$ ls -l /etc/rc3.d/S93rhq-agent
lrwxrwxrwx 1 root root 19 Nov  8  2012 /etc/rc3.d/S93rhq-agent -> ../init.d/rhq-agent

I'm guessing because there's a double link here, it's causing confusion:

_DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null|| echo "$0"`
RHQ_AGENT_WRAPPER_BIN_DIR_PATH=`dirname "$_DOLLARZERO"`
debug_wrapper_msg "RHQ_AGENT_WRAPPER_BIN_DIR_PATH=$RHQ_AGENT_WRAPPER_BIN_DIR_PATH"

$_READLINK_ARG needs to be -f (at least on systems that support it.)

Comment 1 Heiko W. Rupp 2013-06-18 12:30:26 UTC
Elias,
what is your system in question here? OS/X 10.7 does not know about -f, so this can't be it :)

Red Hat Enterprise Linux 6 also seems to do fine with option -e

-f, --canonicalize
              canonicalize by following every symlink in every component of the given name recursively; all but the last
              component must exist

-e, --canonicalize-existing
              canonicalize by following every symlink in every component of the given name recursively,  all  components
              must exist

Comment 2 Elias Ross 2013-06-18 15:18:58 UTC
Looks like this is from my patched version, not the version in the main RHQ tree. Looks like I commented it out because the agent wasn't working on RHEL 5. But this is needed of course.

# -e option not supported on RHEL 5.4
# if [ "x${_LINUX}${_SOLARIS}${_CYGWIN}" != "x" ]; then
   # _READLINK_ARG="-e"
# fi

You can close this out, if you aren't supported RHEL 5.

Comment 3 Elias Ross 2013-06-18 15:20:54 UTC
Also, for those finding this issue, the fix seems to be to update coreutils on those systems:

http://rhn.redhat.com/errata/RHBA-2011-1074.html

but I haven't confirmed this.