Bug 591576 - Request option to to use a directory other than the parent directory for the upgrade jar
Summary: Request option to to use a directory other than the parent directory for the ...
Alias: None
Product: RHQ Project
Classification: Other
Component: Agent
Version: 1.3.1
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Mike Foley
Depends On:
TreeView+ depends on / blocked
Reported: 2010-05-12 15:34 UTC by dsteigne
Modified: 2018-10-27 16:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-05-29 18:03:54 UTC

Attachments (Terms of Use)

Description dsteigne 2010-05-12 15:34:51 UTC
Description of problem:
Customer is requesting the option to to use a directory other than the parent directory for the upgrade jar. 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:

Comment 1 Corey Welton 2010-09-24 12:29:23 UTC
 mazz - what would it take to fix this? (see issuetracker)

Comment 2 John Mazzitelli 2010-09-24 12:51:52 UTC
it would not be trivial to fix this - it would involve alot of work. You'd first have to add a new agent preference to indicate where this other directory would be and then we'd have to get the agent to pass that somehow to the ant script. The ant script would then have to be refactored to install into this new temp directory, clean out the old agent location and copy the new temp content into the original agent location. We'd have to backup the original somewhere too (because we use that to revert back to the old agent if the upgrade fails). So the revert portion of the code/script needs to be refactored to know about this custom temp location. There would be alot here to fix this.

I would say we not do this. The solution to the problem is to make an intermediate level in your file system where the agent and its backup versions can go that you can give proper file permissions.

For example, as I understand the problem, the issue is the user installed the agent in a directory like this:


And the agent is only given write permissions to that directory, and not the parent (/opt). Thus the auto-upgrade fails because we can't write to /opt which is where we'd store/backup our old files and build the new agent.

The solution is to create a intermediate location:


and install the agent to "/opt/rhq/rhq-agent".

You'd give the agent write access to /opt/rhq. This solves the problem.

Comment 3 John Mazzitelli 2010-09-24 12:55:56 UTC
BTW: my recommended solution is already documented here:


"Install The Agent In A Writable Directory

During the update process, files will need to be written in the directory where the agent is currently installed. This means that the parent directory of the agent's install directory must be writable by the user that is running the agent. As an example, if the agent's $RHQ_AGENT_HOME (i.e. where the agent is installed) is the directory called "/opt/rhq-agent-parent/rhq-agent", the agent will need to write files to the "/opt/rhq-agent-parent" directory and therefore must have write permissions there."

So those that are installing the agent should have already followed those instructions. Everyone reads the documentation when they install don't they ;)

Note You need to log in before you can comment on or make changes to this bug.