modules/enterprise/agent/src/etc/java-service-wrapper/rhq-agent-wrapper.conf | 4 ++-- modules/enterprise/agent/src/etc/rhq-agent-wrapper.bat | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-)
New commits: commit d19fd2306f60991e839566934c7fbbcf4f692226 Author: Jay Shaughnessy jshaughn@redhat.com Date: Thu Dec 5 09:39:49 2013 -0500
[1038256] Windows 2008 - Invalid agent service after upgrade (on remote agent machine) This problem resulted from the work in Bug 1016609, when we introduced the use of RHQ_JAVA_EXE_FILE_PATH and deprecated the use of RHQ_AGENT_JAVA_EXE_FILE_PATH (among several simplifications of our env properties). The issue with that change was the fact that existing windows agent services (remote agents, not handled by rhqctl) included set.RHQ_AGENT_JAVA_EXE_FILE_PATH in the service "path to executable", for use by the service wrapper. But the new rhq-agent-wrapper.conf expected RHQ_JAVA_EXE_FILE_PATH to be set when formulating its command string.
This was only an issue for existing agents that would be auto-upgraded. Agent auto-upgrade does not update the existing service, it only restarts it after the agent update. So, the "path to executable" remains unchanged and therefore passes only the legacy property. Note that auto-upgrade does the right thing, it should *not* replace the service in order to update its definition. Doing this could lose the RUN_AS password, which may have been set interactively when the agent was initially installed.
The solution should be good, the rhq-agent-wrapper.conf has been reverted to use RHQ_AGENT_JAVA_EXE_FILE_PATH. We still completely support the new RHQ env properties, like RHQ_JAVA_EXE_FILE_PATH, but will supply the legacy property at service install time. That gives up backward compatibility while keeping the use of RHQ_AGENT_JAVA_EXE_FILE_PATH internal.
Cherry-Pick Master: 719e2c127f24f7467ecc3a371d9797f6598880c0
diff --git a/modules/enterprise/agent/src/etc/java-service-wrapper/rhq-agent-wrapper.conf b/modules/enterprise/agent/src/etc/java-service-wrapper/rhq-agent-wrapper.conf index 3f3712e..a510ea9 100644 --- a/modules/enterprise/agent/src/etc/java-service-wrapper/rhq-agent-wrapper.conf +++ b/modules/enterprise/agent/src/etc/java-service-wrapper/rhq-agent-wrapper.conf @@ -33,7 +33,7 @@ # set.RHQ_AGENT_PASSWORD - the password of the user that is to # run the service. Only used if # RHQ_AGENT_PASSWORD_PROMPT is FALSE. -# set.RHQ_JAVA_EXE_FILE_PATH - Java executable +# set.RHQ_AGENT_JAVA_EXE_FILE_PATH - Java executable #*****************************************************************************
# Load in the specific environment for the RHQ agent instance to start @@ -43,7 +43,7 @@ # Start Properties #***************************************************************************** # Java JVM Executable (quotes not needed) -wrapper.java.command=%RHQ_JAVA_EXE_FILE_PATH% +wrapper.java.command=%RHQ_AGENT_JAVA_EXE_FILE_PATH%
# Java Main class. This class must implement the WrapperListener interface. (quotes not needed) wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp diff --git a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.bat b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.bat index 90e9666..657f701 100644 --- a/modules/enterprise/agent/src/etc/rhq-agent-wrapper.bat +++ b/modules/enterprise/agent/src/etc/rhq-agent-wrapper.bat @@ -146,7 +146,9 @@ if /i "%1"=="install" ( if not defined RHQ_AGENT_PASSWORD_PROMPT set RHQ_AGENT_PASSWORD_PROMPT=true )
- "%RHQ_AGENT_WRAPPER_EXE_FILE_PATH%" -i "%RHQ_AGENT_WRAPPER_CONF_FILE_PATH%" "set.RHQ_AGENT_HOME=%RHQ_AGENT_HOME%" "set.RHQ_AGENT_INSTANCE_NAME=%RHQ_AGENT_INSTANCE_NAME%" "set.RHQ_JAVA_EXE_FILE_PATH=%RHQ_JAVA_EXE_FILE_PATH%" "set.RHQ_AGENT_OS_PLATFORM=%RHQ_AGENT_OS_PLATFORM%" "set.RHQ_AGENT_WRAPPER_LOG_DIR_PATH=%RHQ_AGENT_WRAPPER_LOG_DIR_PATH%" !_WRAPPER_NTSERVICE_ACCOUNT! %_DEBUG_OPTS% + rem note that we set RHQ_AGENT_JAVA_EXE_FILE_PATH on purpose. The services use this legacy env var, as opposed to + rem RHQ_JAVA_EXE_FILE_PATH, to be backward compatible with existing services that get auto-upgraded. + "%RHQ_AGENT_WRAPPER_EXE_FILE_PATH%" -i "%RHQ_AGENT_WRAPPER_CONF_FILE_PATH%" "set.RHQ_AGENT_HOME=%RHQ_AGENT_HOME%" "set.RHQ_AGENT_INSTANCE_NAME=%RHQ_AGENT_INSTANCE_NAME%" "set.RHQ_AGENT_JAVA_EXE_FILE_PATH=%RHQ_JAVA_EXE_FILE_PATH%" "set.RHQ_AGENT_OS_PLATFORM=%RHQ_AGENT_OS_PLATFORM%" "set.RHQ_AGENT_WRAPPER_LOG_DIR_PATH=%RHQ_AGENT_WRAPPER_LOG_DIR_PATH%" !_WRAPPER_NTSERVICE_ACCOUNT! %_DEBUG_OPTS% if ERRORLEVEL 1 goto error goto done )
rhq-commits@lists.fedorahosted.org