Bug 591576

Summary: Request option to to use a directory other than the parent directory for the upgrade jar
Product: [Other] RHQ Project Reporter: dsteigne
Component: AgentAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED NOTABUG QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: low    
Version: 1.3.1CC: jshaughn, mazz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-29 14:03:54 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description dsteigne 2010-05-12 11:34:51 EDT
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 08:29:23 EDT
 mazz - what would it take to fix this? (see issuetracker)
Comment 2 John Mazzitelli 2010-09-24 08:51:52 EDT
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 08:55:56 EDT
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 ;)