Bug 534611 (RHQ-1391)
Summary: | Can't run rhq-agent-wrapper.sh as a service if it is symlinked. | ||
---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Corey Welton <cwelton> |
Component: | Agent | Assignee: | John Mazzitelli <mazz> |
Status: | CLOSED NEXTRELEASE | QA Contact: | Corey Welton <cwelton> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 1.2 | Flags: | cwelton:
archived+
|
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://jira.rhq-project.org/browse/RHQ-1391 | ||
Whiteboard: | |||
Fixed In Version: | 1.2 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: |
Red Hat Enterprise Linux Server release 5.2 (Tikanga) Kernel \r on an \m Linux rlx-0-12.rhndev.redhat.com 2.6.18-92.1.22.el5 #1 SMP Fri Dec 5 09:29:46 EST 2008 i686 i686 i386 GNU/Linux
|
|
Last Closed: | Type: | --- | |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Corey Welton
2009-01-22 18:27:00 UTC
the problem is this line in rhq-agent-wrapper.sh: RHQ_AGENT_WRAPPER_BIN_DIR_PATH=`dirname "$0"` $0 is the value of the sym link, not the real script itself. Will need to use "readlink" here - need to example $0 and if its a symlink, use "readlink" to get the "real" file that the link points to. Now using the following to follow symlinks - if the script isn't a symlink, it still works: _DOLLARZERO=`readlink "$0" || echo "$0"` So, we can now use "$_DOLLARZERO" for the "real" script path, e.g.: RHQ_AGENT_WRAPPER_BIN_DIR_PATH=`dirname "$_DOLLARZERO"` How many flavors of *nix has this been tested on ? This will work on all UNIX's that have "readlink" available and in the path, which from what it looks like is all the ones we care about (I see this working on solaris, rhel and fedora - unsure if readlink is available on aix, hpux, macos - but workaround is simple - provide readlink access to the user running the agent :) QA Verified. This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1391 This bug relates to RHQ-1752 |