jira.rhq-project.org has been archived and is now in read-only mode.

All issues have been moved to bugzilla.redhat.com. All new issues or updates to existing issues should be made through bugzilla.
Specific old RHQ issues can be found using a query of this form: https://bugzilla.redhat.com/show_bug.cgi?id=RHQ-1999.
New bugs can be raised here. Accounts at bugzilla.redhat.com have been created for existing RHQ users.
Open bugs raised in the last week can be found here.
Issue Details (XML | Word | Printable)

Key: RHQ-2444
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Mark Burchard
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RHQ Project

rhq-agent-wrapper.sh needs to be modified to work with SYSV init systems and chkconfig

Created: 30/Sep/09 02:06 PM   Updated: 12/Oct/09 12:39 PM
Return to search
Component/s: Launch Scripts
Affects Version/s: 1.2, 1.3
Fix Version/s: None

Time Tracking:
Not Specified

Environment: Reproduced on RHEL 5.3 and 5.4
Issue Links:
Duplicate
 

Date of First Response: 12/Oct/09 07:34 AM


 Description  « Hide
Line 102 of rhq-agent-wrapper.sh needs to be modified with after -e (Canonical, exists) after the readlink command, eg.

# -------------------------------
# Get the location of this script.
# Make sure we take into account the possibility $0
# is a symlink to the real agent installation script.

_DOLLARZERO=`readlink -e "$0" || echo "$0"`


This is because, at least under RHEL using chkconfig, the script called by init is a symlink to another symlink, the /etc/init.d/rhq-agent-wrapper -> /path/to/real/wrapper/file. This causes the following to happen:

#
# ../rc3.d/S93rhq-agent-wrapper.sh start
#
++ readlink ../rc3.d/S93rhq-agent-wrapper.sh
#
+ _DOLLARZERO=../init.d/rhq-agent-wrapper.sh
#
++ dirname ../init.d/rhq-agent-wrapper.sh
#
+ RHQ_AGENT_WRAPPER_BIN_DIR_PATH=../init.d

Adding the -e option corrects this..

We also need to add some platform-check logic before this, as at least Solaris readlink does not support the -e option.

-Mark

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Mark Burchard added a comment - 30/Sep/09 03:46 PM
Correction: line 104

John Mazzitelli added a comment - 12/Oct/09 07:34 AM
RHQ-2461 reported the same thing, but says you can use -f option to correct the problem.

Does Solaris support the -f option?

Mark Burchard added a comment - 12/Oct/09 12:39 PM
No the Solaris version of readlink does not appear to support any options at all.

However, in the case of Solaris 10, we should be providing an SMF init script[1], which obsoletes the need for readlink.

[1]http://jira.rhq-project.org/browse/RHQ-2449