5 Replies Latest reply on Oct 10, 2013 5:02 PM by lukasz74nj

    java.util.prefs.PreferencesFactory and rhq.preferences.file properties are ignored (4.9.0)

    lukasz74nj

      Hello,

       

      I want to configure my RHQ agents to store the configuration in a property file, as opposed to in a Java Preferences store. Since RHQ agents run under a user that has its home directory on NAS, it is not possible to use a single Java Preferences store (which is located under the user's home directory). As a side note, why does the agent need to store the configuration at runtime anyways? All relevant settings are already located in the XML configuration file.

       

      Going back to my problem, I uncommented the following 2 properties under the Agent's wrapper configuration file (<RHQ_AGENT_HOME>/bin/wrapper/rhq-agent-wrapper.conf):

       

      wrapper.java.additional.7="-Djava.util.prefs.PreferencesFactory=org.rhq.core.util.preferences.FilePreferencesFactory"

      wrapper.java.additional.8="-Drhq.preferences.file=%RHQ_AGENT_HOME%/conf/agent-prefs.properties"

       

      However, the agent still creates the configuration under the user's home directory (~/.java/.userPrefs/rhq-agent/) and the properties file referenced by the second property (%RHQ_AGENT_HOME%/conf/agent-prefs.properties) is never created.

       

      I start the agent using the wrapper control script:

       

      <RHQ_AGENT_HOME>/bin/rhq-agent-wrapper.sh start

       

      Am I missing anything here?

       

      Thanks,

      Lukasz