tmpwatch can erase the EMS jar

Thomas Segismont tsegismo at redhat.com
Fri Sep 26 17:09:11 UTC 2014


Hi Elias,

Le 24/09/2014 19:39, Elias Ross a écrit :
> I have a bug: https://bugzilla.redhat.com/show_bug.cgi?id=1146167
>
> Basically I have a tmpwatch process in place (EL6) and eventually it
> will delete the org-mc4j-ems-impl123xxx.jar file causing all sorts of
> trouble.

I assume your tmpwatch process actually deletes anything "old" in the 
${RHQ_AGENT_HOME}/data/tmp directory, is that correct?

If it is, then be careful as this directory is used by the plugin 
container and many plugins to store all sorts of "not so temporary" 
files (drift change sets, bundle assets, plugin classloaders 
repositories, ... etc).

>
> Is there some reason EMS does this sort of thing? Why not just include
> the impl file in the JMX plugin?

It does this for any EMS connection configured to copy connection 
classpath entries to a temporary directory. For example, if your agent 
monitors an RHQ server and a Tomcat 7 server, you'll find:

RHQ_AGENT_HOME/data/tmp/catalina5297975227644168190.jar
^^ for Tomcat specifics
RHQ_AGENT_HOME/data/tmp/jboss-client2309635217896455836.jar
^^ for JMX connection over AS7 / EAP6 remoting
RHQ_AGENT_HOME/data/tmp/org-mc4j-ems-impl912877660320334049.jar
RHQ_AGENT_HOME/data/tmp/org-mc4j-ems-impl3321936392506161416.jar
^^ one for Tomcat, one for RHQ Server

There are reasons to do this, see TomcatServerComponent source file:
====
// Tell EMS to make copies of jar files so that the ems classloader 
doesn't lock
// application files (making us unable to update them)  Bug: JBNADM-670
====


>
> I'm going to make the change to not use an embedded impl. Please let
> me know if this is not the right idea.

IMO, you should try to change the TomcatServerComponent class so that 
the EMS connection temporary directory becomes something recognizable, like:
====
RHQ_AGENT_HOME/data/tmp/tomcat-xxxx.ems
====

Then you'd be able to configure your cron job to leave it alone.

I'd merge such a PR.

Best regards,
Thomas


More information about the rhq-devel mailing list