Bug 534210 (RHQ-1028) - add agent version checking code to the main agent
Summary: add agent version checking code to the main agent
Keywords:
Status: CLOSED NEXTRELEASE
Alias: RHQ-1028
Product: RHQ Project
Classification: Other
Component: Agent
Version: unspecified
Hardware: All
OS: All
high
medium
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact:
URL: http://jira.rhq-project.org/browse/RH...
Whiteboard:
Depends On:
Blocks: RHQ-110
TreeView+ depends on / blocked
 
Reported: 2008-10-25 17:42 UTC by John Mazzitelli
Modified: 2009-11-10 21:22 UTC (History)
0 users

Fixed In Version: 1.2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description John Mazzitelli 2008-10-25 17:42:00 UTC
Create the code that will have the agent determine if it needs to be updated. This is the code that will do things like:

a) ask the server's agent update servlet what version of the agent it has (i.e. what is the latest version of the agent - this is the version that our currently running agent should be).

if a) tells the agent that it is not current and needs to be updated then the following is to be done:

b) the agent must ask the servlet for the latest agent update binary
c) run the agent update binary in a separate VM (java -jar agent-update-binary.jar --update)
d) shutdown the agent completely, exiting the agent's VM

for more info, see http://support.rhq-project.org/display/RHQ/Design-AgentAutoUpdate

Comment 1 John Mazzitelli 2008-11-12 22:23:37 UTC
agent needs to check the integrity of the downloaded jar by doing md5 comparisions.
the agentupdate/version URL will provide a rhq-agent.latest.md5 property.

this obviously isn't for security - its just to validate that the download wasn't corrupted somehow coming down over the wire.

Comment 2 John Mazzitelli 2008-11-16 08:16:38 UTC
svn rev2010 starts this work.  there is now AgentUpdateCheck that asks the server for the version info of the update and it compares the current version. "update" prompt command has been added so you can ask at the command prompt for the "--version" info as well as being able to "--enable" and "--disable" the agent-update-enable flag.

Nices to have include:

being able to say "update --download=[<output-dir>]" and have it download the agent update binary AND check its MD5, placing the .jar in the given output-dir, or in some other place (/data/tmp ?, /update ?)) as a default.

being able to say "update --apply" to have it download and apply the update. this is the hard part and involves doing the actual update, and restarting the agent.

Comment 3 John Mazzitelli 2008-11-17 07:18:43 UTC
svn rev 2012 - agent now has code that downloads the update binary from the server. update prompt command lets you download it. no auto-update or auto-version checks yet.

currently only stores the download file to java.io.tmpdir - need to investigate if we should allow putting it under rhq-agent - since to apply the update that rhq-agent directory gets backed up and moved - don't think we can run the update which would at the same time move the update .jar.


Comment 4 John Mazzitelli 2008-12-11 19:37:25 UTC
code that launches the update threads after the version is detected to be out of date is now in...svn rev 2326

Comment 5 Red Hat Bugzilla 2009-11-10 20:22:10 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1028
This bug is related to RHQ-1158



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