modules/enterprise/agent/ant-run.xml
| 2
modules/enterprise/agent/src/etc/java-service-wrapper/rhq-agent-wrapper.inc
| 19 +
modules/enterprise/agent/src/etc/rhq-agent-env.bat
| 10
modules/enterprise/agent/src/etc/rhq-agent.bat
| 12
modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
| 124 +++++++---
modules/enterprise/remoting/cli/src/etc/rhq-cli-env.bat
| 26 --
modules/enterprise/remoting/cli/src/etc/rhq-cli.bat
| 45 +--
modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-installer.bat
| 12
modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-server.bat
| 12
modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage-installer.bat
| 12
modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage.bat
| 12
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-data-migration.bat
| 12
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.bat
| 15 -
modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.inc
| 19 +
modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.env
| 25 +-
modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.inc
| 19 +
modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
| 12
modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
| 87 +++++--
19 files changed, 325 insertions(+), 152 deletions(-)
New commits:
commit 93cbc9c4426363db4d63b4270ba49ba20f7ebe16
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Mon Oct 28 09:35:24 2013 -0400
Bug 1022620 - Windows 2008 - Upgrade to JON3.2.ER3 fails when using oracle jdk7-32b
Second commit for this.
Went one step further. Now for the server and agent we create/set java.io.tmpdir
to InstallDir/temp, if the original java.io.tmpdir is invalid. We'll generate
a warning about the original setting. We'll only exit if our attempt to
create/set a local temp dir fails. This helps us succeed out of box with
the known issues using the 32-bit JVm on Windows, as well as getting
around the issue in general.
cherry-pick master: fdc1cabee3ea72a167f71971a7d4c8f324b8e8db
diff --git
a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
index 77c88b1..c99f4b6 100644
--- a/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
+++ b/modules/enterprise/agent/src/main/java/org/rhq/enterprise/agent/AgentMain.java
@@ -368,7 +368,7 @@ public class AgentMain {
private VMHealthCheckThread m_vmHealthCheckThread;
/**
- * Counts the number of times the agent has been restarted and holds the reason for
the last restart.
+ * Counts the number of times the agent has been restarted and holds the reason for
the last restart.
*/
private final AgentRestartCounter m_agentRestartCounter = new AgentRestartCounter();
@@ -378,7 +378,7 @@ public class AgentMain {
private boolean m_disableNativeSystem;
/**
- * Thread used to repeatedly ping the server for connectivity, agent avail update,
and clock sync
+ * Thread used to repeatedly ping the server for connectivity, agent avail update,
and clock sync
*/
private ScheduledThreadPoolExecutor m_pingThreadPoolExecutor;
@@ -465,6 +465,62 @@ public class AgentMain {
return;
}
+ private void checkTempDir() {
+ File tmpDir = new File(System.getProperty("java.io.tmpdir"));
+ if (!tmpDir.exists()) {
+ LOG.warn("Invalid java.io.tmpdir: [" + tmpDir.getAbsolutePath() +
"] does not exist.");
+ useLocalTmpDir();
+ return;
+ }
+ if (!tmpDir.isDirectory()) {
+ LOG.warn("Invalid java.io.tmpdir: [" + tmpDir.getAbsolutePath() +
"] is not a directory");
+ useLocalTmpDir();
+ return;
+ }
+ if (!tmpDir.canRead() || !tmpDir.canExecute()) {
+ LOG.warn("Invalid java.io.tmpdir: [" + tmpDir.getAbsolutePath() +
"] is not readable");
+ useLocalTmpDir();
+ return;
+ }
+ if (!tmpDir.canWrite()) {
+ LOG.warn("Invalid java.io.tmpdir: [" + tmpDir.getAbsolutePath() +
"] is not writable");
+ useLocalTmpDir();
+ return;
+ }
+ }
+
+ private void useLocalTmpDir() {
+ File localTmpDir = null;
+ try {
+ localTmpDir = new File(new File(getAgentHomeDirectory()), "temp");
+ LOG.info("Using alternate java.io.tmpdir: [" +
localTmpDir.getAbsolutePath() + "]");
+ if (!localTmpDir.exists()) {
+ LOG.info("Creating alternate java.io.tmpdir: [" +
localTmpDir.getAbsolutePath() + "]");
+ localTmpDir.mkdir();
+ }
+ System.setProperty("java.io.tmpdir",
localTmpDir.getAbsolutePath());
+ } catch (Throwable t) {
+ throw new RuntimeException("Startup failed: Could not create or set
local java.io.tmpdir ["
+ + localTmpDir.getAbsolutePath() + "]", t);
+ }
+ if (!localTmpDir.exists()) {
+ throw new RuntimeException("Startup failed: local java.io.tmpdir ["
+ localTmpDir.getAbsolutePath()
+ + "] does not exist");
+ }
+ if (!localTmpDir.isDirectory()) {
+ throw new RuntimeException("Startup failed: local java.io.tmpdir ["
+ localTmpDir.getAbsolutePath()
+ + "] is not a directory");
+ }
+ if (!localTmpDir.canRead() || !localTmpDir.canExecute()) {
+ throw new RuntimeException("Startup failed: local java.io.tmpdir ["
+ localTmpDir.getAbsolutePath()
+ + "] is not readable");
+ }
+ if (!localTmpDir.canWrite()) {
+ throw new RuntimeException("Startup failed: local java.io.tmpdir ["
+ localTmpDir.getAbsolutePath()
+ + "] is not writable");
+ }
+ }
+
/**
* Constructor for {@link AgentMain} that loads the agent configuration and prepare
some additional internal data.
*
@@ -517,13 +573,15 @@ public class AgentMain {
prepareNativeSystem();
+ checkTempDir();
+
return;
}
/**
* Returns the directory that is considered the "agent home" (i.e. the
directory
* where the agent is installed).
- *
+ *
* @return agent home directory, or empty string if it cannot be determined
*/
public String getAgentHomeDirectory() {
@@ -614,7 +672,7 @@ public class AgentMain {
/**
* This method should be called whenever the server time is known. This helps
* keep the {@link #getAgentServerClockDifference()} up-to-date.
- *
+ *
* @param serverTime the currently know value of the server clock (epoch millis)
*/
public void serverClockNotification(long serverTime) {
@@ -920,7 +978,7 @@ public class AgentMain {
/**
* This will enable/disable agent-server communication tracing. This is for
* use mainly in development but can also be used for troubleshooting problems.
- *
+ *
* @param enabled whether or not to turn on agent comm tracing
*/
public void agentServerCommunicationsTrace(boolean enabled) {
@@ -952,7 +1010,7 @@ public class AgentMain {
* This will hot-deploy a new log4j log configuration file. Use this to change, at
runtime,
* the log settings so you can, for example, begin logging DEBUG messages to help
troubleshoot
* problems.
- *
+ *
* @param logFilePath the path to the log file - relative to the classloader or
filesystem
*
* @throws Exception if failed to hot deploy the new log config
@@ -985,7 +1043,7 @@ public class AgentMain {
/**
* Returns an iteratable list of servers that can be used as backups when this agent
needs to failover
* to another server.
- *
+ *
* @return list of servers (may be empty but will not be
<code>null</code>)
*/
public FailoverListComposite getServerFailoverList() {
@@ -1029,8 +1087,8 @@ public class AgentMain {
/**
* Downloads a new server failover list from the server and returns the failover
list
* that is now in effect.
- * @return
- *
+ * @return
+ *
* @return the server failover list that is now in effect
*/
public FailoverListComposite downloadServerFailoverList() {
@@ -1568,7 +1626,7 @@ public class AgentMain {
* @param wait_ms maximum number of milliseconds to wait
*
* @return <code>true</code> if the server is up,
<code>false</code> if it is not yet up or the agent has shutdown
- *
+ *
* @throws AgentNotSupportedException If the server is up but it told us we are the
wrong version, then this is thrown.
* When this is thrown, the agent is currently in
the midst of updating itself.
*/
@@ -1940,9 +1998,9 @@ public class AgentMain {
* port and transport parameters being used to talk to the current server
* will stay the same. Otherwise, it will be assumed the server is a
* full endpoint URL.
- *
+ *
* @param server the host of the server to switch to, or a full server endpoint URL
- *
+ *
* @return <code>true</code> if successfully switched,
<code>false</code> otherwise
*/
public boolean switchToServer(String server) {
@@ -1996,9 +2054,9 @@ public class AgentMain {
/**
* Switches the agent to talk to the next server in the failover list.
- *
+ *
* This is package-scoped so the failover callback can call this.
- *
+ *
* @param comm the communicator object whose endpoint needs to be switched to the
next server
* the caller must ensure the remote communicator provided to this method
is the
* same communicator used by this agent's {@link
#getClientCommandSender() sender}.
@@ -2036,12 +2094,12 @@ public class AgentMain {
/**
* Immediately switches the given communicator to the given server.
- *
+ *
* @param comm the communicator whose server is switched
* @param newServer the endpoint of the new server
* @param transport the transport that should be used in the new remote endpoint URL
* @param transportParams the transport params that should be used in the new remote
endpoint URL
- *
+ *
* @return <code>true</code> if successfully switched;
<code>false</code> otherwise
*/
private boolean switchCommServer(RemoteCommunicator comm, ServerEntry newServer,
String transport,
@@ -2096,12 +2154,12 @@ public class AgentMain {
* is making the server its primary server and will begin sending it messages. The
request
* is sent such that the communicator's initialize callback will never be
invoked, however,
* the caller can ask for the request to attempt failover.
- *
+ *
* <p>This is package scoped so the initialize callback can call
this</p>
- *
+ *
* @param comm the communicator used to send the message to the server
* @param attemptFailover if <code>true</code>, and the connect command
fails, server failover will be attempted
- *
+ *
* @throws Throwable
*/
void sendConnectRequestToServer(RemoteCommunicator comm, boolean attemptFailover)
throws Throwable {
@@ -2203,7 +2261,7 @@ public class AgentMain {
/**
* Returns the agent restart counter object.
- *
+ *
* @return the agent restart counter
*/
public AgentRestartCounter getAgentRestartCounter() {
@@ -2351,7 +2409,7 @@ public class AgentMain {
m_commServices.start(m_configuration.getPreferences(),
m_configuration.getClientCommandSenderConfiguration());
// prime the sender so it can be prepared to start sending messages.
- // if auto-discovery is enabled, then the auto-discovery listener will tell the
sender when its OK to start
+ // if auto-discovery is enabled, then the auto-discovery listener will tell the
sender when its OK to start
// sending. Otherwise start polling and let the poller tell the sender when it
is ok to start sending.
if (!isAutoDiscoveryEnabled()) {
LOG.info(AgentI18NResourceKeys.NO_AUTO_DETECT);
@@ -2402,7 +2460,7 @@ public class AgentMain {
/**
* This will prepare the auto-discovery listener, if server auto-detection is
enabled.
- *
+ *
* @throws Exception
*/
private void prepareAutoDiscoveryListener() throws Exception {
@@ -2638,17 +2696,17 @@ public class AgentMain {
/**
* Creates a raw remote communicator that can talk to the given endpoint.
- *
+ *
* This is public-scoped so the {@link PrimaryServerSwitchoverThread} can use this
* and the {@link IdentifyPromptCommand} can use this.
- *
+ *
* @param transport
* @param address
* @param port
* @param transportParams
- *
+ *
* @return the remote communicator
- *
+ *
* @throws Exception if the communicator could not be created
*/
public RemoteCommunicator createServerRemoteCommunicator(String transport, String
address, int port,
@@ -2741,7 +2799,7 @@ public class AgentMain {
* Given a failover list, this makes very rudimentary connection attempts to each
server to see if
* this agent can at least reach the server endpoints. If an endpoint cannot be
reached,
* a warning is logged.
- *
+ *
* @param failoverList the list of servers this agent will potentially need to talk
to.
* @return the servers that failed to be connected to
*/
@@ -2804,7 +2862,7 @@ public class AgentMain {
* Given a failover list, this will persist it so the agent can recover it if the
agent itself fails.
* If this method fails to persist the list, an error is logged but otherwise this
method
* returns normally.
- *
+ *
* @param failoverList the failover list to persist (may be
<code>null</code>)
*/
private void storeServerFailoverList(FailoverListComposite failoverList) {
@@ -3184,7 +3242,7 @@ public class AgentMain {
}
if (m_daemonMode) {
-
AgentInputReaderFactory.setConsoleType(AgentInputReaderFactory.ConsoleType.java); //
don't use native libs, no need and jline causes problems
+
AgentInputReaderFactory.setConsoleType(AgentInputReaderFactory.ConsoleType.java); //
don't use native libs, no need and jline causes problems
} else if (console_type != null) {
AgentInputReaderFactory.setConsoleType(console_type);
}
@@ -3373,7 +3431,7 @@ public class AgentMain {
return args.toArray(new String[args.size()]);
}
- // perform any other massaging
+ // perform any other massaging
private String safeArg(String arg) {
// remove trailing '=' from long option args. For example --plugin=
should just be --plugin for
// downstream processing.
@@ -3642,7 +3700,7 @@ public class AgentMain {
* </ol>
* By restarting the plugin container in such conditions, we essentially re-run the
resource upgrade
* and let the plugin container try to re-merge with the server that we know has just
connected.
- *
+ *
* @author Lukas Krejci
*/
private class PluginContainerConditionalRestartListener implements
ClientCommandSenderStateListener {
@@ -3750,7 +3808,7 @@ public class AgentMain {
try {
// if we can't send to the server ignore the ping
if (!m_clientSender.isSending()) {
- // An unlikely state, but if we're not sending, not polling and
not performing autoDiscovery
+ // An unlikely state, but if we're not sending, not polling and
not performing autoDiscovery
// (multicast), then start polling to we eventually get out of this
state.
if (!(m_clientSender.isServerPolling() || isAutoDiscoveryEnabled()))
{
LOG.info(AgentI18NResourceKeys.PING_EXECUTOR_STARTING_POLLING);
@@ -3760,7 +3818,7 @@ public class AgentMain {
return;
}
- // we are in sending mode, so make sure the poller is off
+ // we are in sending mode, so make sure the poller is off
if (m_clientSender.isServerPolling()) {
LOG.info(AgentI18NResourceKeys.PING_EXECUTOR_STOPPING_POLLING_RESUME_PING);
m_clientSender.stopServerPolling();
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
index d5878c6..941ae93 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
@@ -236,20 +236,56 @@ public class StartupBean implements StartupLocal {
private void checkTempDir() {
File tmpDir = new File(System.getProperty("java.io.tmpdir"));
if (!tmpDir.exists()) {
- throw new RuntimeException("Startup failed: java.io.tmpdir '" +
tmpDir.getAbsolutePath()
- + "' does not exist");
+ log.warn("Invalid java.io.tmpdir: [" + tmpDir.getAbsolutePath() +
"] does not exist.");
+ useLocalTmpDir();
+ return;
}
if (!tmpDir.isDirectory()) {
- throw new RuntimeException("Startup failed: java.io.tmpdir '" +
tmpDir.getAbsolutePath()
- + "' is not a directory");
+ log.warn("Invalid java.io.tmpdir: [" + tmpDir.getAbsolutePath() +
"] is not a directory");
+ useLocalTmpDir();
+ return;
}
if (!tmpDir.canRead() || !tmpDir.canExecute()) {
- throw new RuntimeException("Startup failed: java.io.tmpdir '" +
tmpDir.getAbsolutePath()
- + "' is not readable");
+ log.warn("Invalid java.io.tmpdir: [" + tmpDir.getAbsolutePath() +
"] is not readable");
+ useLocalTmpDir();
+ return;
}
if (!tmpDir.canWrite()) {
- throw new RuntimeException("Startup failed: java.io.tmpdir '" +
tmpDir.getAbsolutePath()
- + "' is not writable");
+ log.warn("Invalid java.io.tmpdir: [" + tmpDir.getAbsolutePath() +
"] is not writable");
+ useLocalTmpDir();
+ return;
+ }
+ }
+
+ private void useLocalTmpDir() {
+ File localTmpDir = null;
+ try {
+ localTmpDir = new File(LookupUtil.getCoreServer().getInstallDir(),
"temp");
+ log.info("Using alternate java.io.tmpdir: [" +
localTmpDir.getAbsolutePath() + "]");
+ if (!localTmpDir.exists()) {
+ log.info("Creating alternate java.io.tmpdir: [" +
localTmpDir.getAbsolutePath() + "]");
+ localTmpDir.mkdir();
+ }
+ System.setProperty("java.io.tmpdir",
localTmpDir.getAbsolutePath());
+ } catch (Throwable t) {
+ throw new RuntimeException("Startup failed: Could not create or set
local java.io.tmpdir ["
+ + localTmpDir.getAbsolutePath() + "]", t);
+ }
+ if (!localTmpDir.exists()) {
+ throw new RuntimeException("Startup failed: local java.io.tmpdir ["
+ localTmpDir.getAbsolutePath()
+ + "] does not exist");
+ }
+ if (!localTmpDir.isDirectory()) {
+ throw new RuntimeException("Startup failed: local java.io.tmpdir ["
+ localTmpDir.getAbsolutePath()
+ + "] is not a directory");
+ }
+ if (!localTmpDir.canRead() || !localTmpDir.canExecute()) {
+ throw new RuntimeException("Startup failed: local java.io.tmpdir ["
+ localTmpDir.getAbsolutePath()
+ + "] is not readable");
+ }
+ if (!localTmpDir.canWrite()) {
+ throw new RuntimeException("Startup failed: local java.io.tmpdir ["
+ localTmpDir.getAbsolutePath()
+ + "] is not writable");
}
}
@@ -546,19 +582,19 @@ public class StartupBean implements StartupLocal {
}
}
- /**
- * This seeds the agent clients cache with clients for all known agents. These
clients will be started so they can
- * immediately begin to send any persisted guaranteed messages that might already
exist. This method must be called
- * at a time when the server is ready to accept messages from agents because any
guaranteed messages that are
- * delivered might trigger the agents to send messages back to the server.
- *
- * NOTE: we don't need to do this - so far, none of the messages the server sends
to the agent are marked
- * with "guaranteed delivery" (this is on purpose and a good thing) so we
don't need to start all the agent clients
- * in case they have persisted messages. Since the number of agents could be large
this cache could be huge and
- * take some time to initialize. If we don't call this, it speeds up start up,
and doesn't bloat memory with
- * clients we might not ever need (since agents might have affinity to other
servers). Agent clients
- * can be created lazily at runtime when the server needs it.
- */
+ /**
+ * This seeds the agent clients cache with clients for all known agents. These
clients will be started so they can
+ * immediately begin to send any persisted guaranteed messages that might already
exist. This method must be called
+ * at a time when the server is ready to accept messages from agents because any
guaranteed messages that are
+ * delivered might trigger the agents to send messages back to the server.
+ *
+ * NOTE: we don't need to do this - so far, none of the messages the server
sends to the agent are marked
+ * with "guaranteed delivery" (this is on purpose and a good thing) so we
don't need to start all the agent clients
+ * in case they have persisted messages. Since the number of agents could be large
this cache could be huge and
+ * take some time to initialize. If we don't call this, it speeds up start up,
and doesn't bloat memory with
+ * clients we might not ever need (since agents might have affinity to other
servers). Agent clients
+ * can be created lazily at runtime when the server needs it.
+ */
private void startAgentClients() {
log.info("Starting agent clients - any persisted messages with guaranteed
delivery will be sent...");
@@ -598,7 +634,7 @@ public class StartupBean implements StartupLocal {
final long initialDelay = 1000L * 60;
final long interval = 1000L * 60;
schedulerBean.scheduleSimpleRepeatingJob(SavedSearchResultCountRecalculationJob.class,
true, false,
- initialDelay, interval);
+ initialDelay, interval);
} catch (Exception e) {
log.error("Cannot schedule asynchronous resource deletion job.",
e);
}
@@ -636,7 +672,7 @@ public class StartupBean implements StartupLocal {
final long initialDelay = 1000L * 60;
final long interval = 1000L * 60;
schedulerBean.scheduleSimpleRepeatingJob(DynaGroupAutoRecalculationJob.class,
true, false, initialDelay,
- interval);
+ interval);
} catch (Exception e) {
log.error("Cannot schedule DynaGroup auto-recalculation job.", e);
}
@@ -738,9 +774,9 @@ public class StartupBean implements StartupLocal {
log.error("Cannot create storage cluster init job", e);
}
}
-
+
try {
- String cronString = "0 30 0 ? * SUN *"; // every sunday starting
at 00:30.
+ String cronString = "0 30 0 ? * SUN *"; // every sunday starting at
00:30.
schedulerBean.scheduleSimpleCronJob(StorageClusterReadRepairJob.class, true,
true, cronString);
} catch (Exception e) {
log.error("Cannot create storage cluster read repair job", e);
@@ -754,6 +790,7 @@ public class StartupBean implements StartupLocal {
*
* @deprecated we don't have an embedded agent anymore, leaving this in case we
resurrect it
*/
+ @Deprecated
private void startEmbeddedAgent() throws RuntimeException {
// we can't use EmbeddedAgentBootstrapServiceMBean because if the embedded
agent
// isn't installed, that class will not be available; we must use JMX API
commit d34ef2053001dd2ecb7bc17614950f508dfefb60
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Oct 25 14:17:27 2013 -0400
Bug 1022620 - Windows 2008 - Upgrade to JON3.2.ER3 fails when using oracle jdk7-32b
The 64bit Java distribution assumes that it will run a '-server' JVM, which
is required by RHQ (in part because the underlying AS7 also requires it but
also because it should run as a server). The 32bit distribution still makes
a distinction between a client JVM (optimized to be lightweight) and a server
JVM (optimized to perform). Only the 32bit JDK supplies the server JVM, so
for 32 Java bit we require the JDK.
By default the 32bit distribution installs under 'c:\Program Files
(x86)\Java\'.
Unfortunately, our scripts failed when RHQ_JAVA_HOME was set to this
directory, because the parentheses cause issues with the script conditionals,
which (by brilliant M$ design) use parens for grouping. So, fix #1 in this
check-in is to enable and delayed expansion of variables in the scripts, in our
logic determining where the java exe is.
On Windows we install RHQ into three windows services, one for storage, server
and agent. By default, the (non--user) local system account runs the services.
Unfortunately, when using the 32bit distribution the java.io.tmpdir then
resolves to a locked-down temp directory under windows/system32, which
subsequently stops things from working. The workaround is to use a user
account via RUN_AS[_ME] or to redefined java.io.tmpdir to be a valid
directory. The latter choice is somewhat involved as you need to update
the property in all three service wrapper configurations. This was not
as easily supported as it could be, so fix #2 is to add wrapper.inc files
for all of the components and beef up some commenting in several of our
script/conf files.
Also in this commit:
- fix the CLI scripts to use the new RHQ_JAVA_HOME and RHQ_JAVA_EXE_FILE_PATH
properties. This had been previously missed.
- make the dev version of rhq-server-wrapper.inc apply lower mem settings.
ToDo: Wiki doco around 32bit distribution.
Conflicts:
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.bat
Cherry-pick of master: 6d87af2dd0ffaa7ecad1e1ed6d67ac7f0ff45129
diff --git a/modules/enterprise/agent/ant-run.xml b/modules/enterprise/agent/ant-run.xml
index 4816e1c..d6ebbfb 100644
--- a/modules/enterprise/agent/ant-run.xml
+++ b/modules/enterprise/agent/ant-run.xml
@@ -186,7 +186,7 @@ Ant Script that provides ways to package the Agent.
<copy todir="${agent.distro.dir}/bin/wrapper">
<fileset dir="${basedir}/src/etc/java-service-wrapper"
- includes="rhq-agent-wrapper.conf"/>
+ includes="rhq-agent-wrapper.*"/>
</copy>
<copy todir="${agent.distro.dir}/bin/wrapper/windows-x86_32">
diff --git a/modules/enterprise/agent/src/etc/java-service-wrapper/rhq-agent-wrapper.inc
b/modules/enterprise/agent/src/etc/java-service-wrapper/rhq-agent-wrapper.inc
new file mode 100644
index 0000000..cd22661
--- /dev/null
+++ b/modules/enterprise/agent/src/etc/java-service-wrapper/rhq-agent-wrapper.inc
@@ -0,0 +1,19 @@
+#*****************************************************************************
+# RHQ Agent Java Service Wrapper Settings Include File
+#
+# This file specifies a set of additional environment variables that will be
+# applied to the RHQ Agent JVM. This file will likely be empty.
+#
+# If adding additional Java properties note that the properties must follow
+# a strict number ordering (that continues from rhq-agent-wrapper.conf)
+# and currently must start with:
+#
+# wrapper.java.additional.9=
+#
+# For example, to set a non-default temp directory for Java:
+# Note: use forward slashes for directories:
+#
+# wrapper.java.additional.9="-Djava.io.tmpdir=c:/temp"
+#
+#*****************************************************************************
+
diff --git a/modules/enterprise/agent/src/etc/rhq-agent-env.bat
b/modules/enterprise/agent/src/etc/rhq-agent-env.bat
index bfa2c9a..56485a1 100644
--- a/modules/enterprise/agent/src/etc/rhq-agent-env.bat
+++ b/modules/enterprise/agent/src/etc/rhq-agent-env.bat
@@ -30,7 +30,7 @@ rem RHQ_JAVA_EXE_FILE_PATH is set.
rem If this and RHQ_JAVA_EXE_FILE_PATH are
rem not set, JAVA_HOME will be used.
rem
-rem set RHQ_JAVA_HOME=C:\opt\java
+rem set RHQ_JAVA_HOME=
rem RHQ_JAVA_EXE_FILE_PATH - Defines the full path to the Java
rem executable to use. If this is set,
@@ -41,11 +41,13 @@ rem is used. If this and
rem RHQ_JAVA_HOME are not set, then
rem JAVA_HOME will be used.
rem
-rem set RHQ_JAVA_EXE_FILE_PATH=C:\WINDOWS\system32\java.exe
+rem set RHQ_JAVA_EXE_FILE_PATH=
rem ===========================================================================
-rem THE FOLLOWING ARE USED SOLELY FOR THE rhq-agent.bat SCRIPT
-rem THESE ARE NOT USED/IGNORED BY rhq-agent-wrapper.bat SCRIPT
+rem THE FOLLOWING ARE USED SOLELY FOR THE rhq-agent.bat SCRIPT,
+rem THEY ARE IGNORED BY rhq-agent-wrapper.bat SCRIPT. See the
+rem rhq-agent-wrapper.conf and rhq-agent-wrapper.inc for more
+rem on setting Java options.
rem RHQ_AGENT_JAVA_OPTS - Java VM command line options to be
rem passed into the agent's VM. If this is not defined
diff --git a/modules/enterprise/agent/src/etc/rhq-agent.bat
b/modules/enterprise/agent/src/etc/rhq-agent.bat
index 59b2e3c..f7980b3 100644
--- a/modules/enterprise/agent/src/etc/rhq-agent.bat
+++ b/modules/enterprise/agent/src/etc/rhq-agent.bat
@@ -19,7 +19,7 @@ rem If the embedded JRE is to be used but is not available, the
fallback
rem JRE to be used will be determined by the JAVA_HOME environment variable.
rem ===========================================================================
-setlocal
+setlocal enabledelayedexpansion
if "%1"=="_SETENV_ONLY" (
set _SETENV_ONLY=true
@@ -78,23 +78,23 @@ rem
----------------------------------------------------------------------
if not defined RHQ_JAVA_EXE_FILE_PATH (
if defined RHQ_AGENT_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_AGENT_JAVA_EXE_FILE_PATH%
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_AGENT_JAVA_EXE_FILE_PATH!
)
)
if not defined RHQ_JAVA_HOME (
if defined RHQ_AGENT_JAVA_HOME (
- set RHQ_JAVA_HOME=%RHQ_AGENT_JAVA_HOME%
+ set RHQ_JAVA_HOME=!RHQ_AGENT_JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
if not defined RHQ_JAVA_HOME (
- if defined RHQ_AGENT_DEBUG echo No RHQ JAVA property set, defaulting to JAVA_HOME:
%JAVA_HOME%
- set RHQ_JAVA_HOME=%JAVA_HOME%
+ if defined RHQ_AGENT_DEBUG echo No RHQ JAVA property set, defaulting to JAVA_HOME:
!JAVA_HOME!
+ set RHQ_JAVA_HOME=!JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_JAVA_HOME%\bin\java.exe
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_JAVA_HOME!\bin\java.exe
)
if defined RHQ_AGENT_DEBUG echo RHQ_JAVA_HOME: %RHQ_JAVA_HOME%
diff --git a/modules/enterprise/remoting/cli/src/etc/rhq-cli-env.bat
b/modules/enterprise/remoting/cli/src/etc/rhq-cli-env.bat
index 8ef3b68..d5d1189 100644
--- a/modules/enterprise/remoting/cli/src/etc/rhq-cli-env.bat
+++ b/modules/enterprise/remoting/cli/src/etc/rhq-cli-env.bat
@@ -16,22 +16,18 @@ rem directory of the directory where this script
lives.
rem
rem set RHQ_CLI_HOME=C:\opt\rhq-cli
-rem RHQ_CLI_JAVA_HOME - The location of the JRE that the CLI will
-rem use. This will be ignored if
-rem RHQ_CLI_JAVA_EXE_FILE_PATH is set.
-rem If this and RHQ_CLI_JAVA_EXE_FILE_PATH are
-rem not set, the CLI will default to JAVA_HOME.
-rem
-rem set RHQ_CLI_JAVA_HOME=
+rem RHQ_JAVA_HOME - The location of the JRE that the server will use. This
+rem will be ignored if RHQ_JAVA_EXE_FILE_PATH is set.
+rem If this and RHQ_JAVA_EXE_FILE_PATH are not set, then
+rem JAVA_HOME will be used.
+rem set RHQ_JAVA_HOME=
-rem RHQ_CLI_JAVA_EXE_FILE_PATH - Defines the full path to the Java
-rem executable to use. If this is set,
-rem RHQ_CLI_JAVA_HOME is ignored.
-rem If this is not set, then
-rem %RHQ_CLI_JAVA_HOME%\bin\java.exe
-rem is used.
-rem
-rem set RHQ_CLI_JAVA_EXE_FILE_PATH=C:\WINDOWS\system32\java.exe
+rem RHQ_JAVA_EXE_FILE_PATH - Defines the full path to the Java executable to
+rem use. If this is set, RHQ_JAVA_HOME is ignored.
+rem If this is not set, then $RHQ_JAVA_HOME/bin/java
+rem is used. If this and RHQ_JAVA_HOME are not set,
+rem then $JAVA_HOME/bin/java will be used.
+rem set RHQ_JAVA_EXE_FILE_PATH=
rem RHQ_CLI_JAVA_OPTS - Java VM command line options to be
rem passed into the CLI's VM. If this is not defined
diff --git a/modules/enterprise/remoting/cli/src/etc/rhq-cli.bat
b/modules/enterprise/remoting/cli/src/etc/rhq-cli.bat
index 0d80d3e..b7992c5 100644
--- a/modules/enterprise/remoting/cli/src/etc/rhq-cli.bat
+++ b/modules/enterprise/remoting/cli/src/etc/rhq-cli.bat
@@ -11,7 +11,7 @@ rem are described in comments in rhq-cli-env.bat. The variables can also
be
rem set via rhq-cli-env.bat, which is sourced by this script.
rem ===========================================================================
-setlocal
+setlocal enabledelayedexpansion
title RHQ CLI
@@ -56,22 +56,36 @@ if defined RHQ_CLI_DEBUG echo RHQ_CLI_HOME: %RHQ_CLI_HOME%
rem ----------------------------------------------------------------------
rem Find the Java executable and verify we have a VM available
+rem Note that RHQ_CLI_JAVA_* props are still handled for back compat
rem ----------------------------------------------------------------------
-if not defined RHQ_CLI_JAVA_EXE_FILE_PATH (
- if not defined RHQ_CLI_JAVA_HOME call :prepare_embedded_jre
+if not defined RHQ_JAVA_EXE_FILE_PATH (
+ if defined RHQ_CLI_JAVA_EXE_FILE_PATH (
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_CLI_JAVA_EXE_FILE_PATH!
+ )
+)
+if not defined RHQ_JAVA_HOME (
+ if defined RHQ_CLI_JAVA_HOME (
+ set RHQ_JAVA_HOME=!RHQ_CLI_JAVA_HOME!
+ )
)
-if not defined RHQ_CLI_JAVA_EXE_FILE_PATH (
- set RHQ_CLI_JAVA_EXE_FILE_PATH=%RHQ_CLI_JAVA_HOME%\bin\java.exe
+if not defined RHQ_JAVA_EXE_FILE_PATH (
+ if not defined RHQ_JAVA_HOME (
+ if defined RHQ_CLI_DEBUG echo No RHQ JAVA property set, defaulting to JAVA_HOME:
!JAVA_HOME!
+ set RHQ_JAVA_HOME=!JAVA_HOME!
+ )
+)
+if not defined RHQ_JAVA_EXE_FILE_PATH (
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_JAVA_HOME!\bin\java.exe
)
-if defined RHQ_CLI_DEBUG echo RHQ_CLI_JAVA_HOME: %RHQ_CLI_JAVA_HOME%
-if defined RHQ_CLI_DEBUG echo RHQ_CLI_JAVA_EXE_FILE_PATH: %RHQ_CLI_JAVA_EXE_FILE_PATH%
+if defined RHQ_CLI_DEBUG echo RHQ_JAVA_HOME: %RHQ_JAVA_HOME%
+if defined RHQ_CLI_DEBUG echo RHQ_JAVA_EXE_FILE_PATH: %RHQ_JAVA_EXE_FILE_PATH%
-if not exist "%RHQ_CLI_JAVA_EXE_FILE_PATH%" (
+if not exist "%RHQ_JAVA_EXE_FILE_PATH%" (
echo There is no JVM available.
- echo Please set RHQ_CLI_JAVA_HOME or RHQ_CLI_JAVA_EXE_FILE_PATH appropriately.
+ echo Please set RHQ_JAVA_HOME or RHQ_JAVA_EXE_FILE_PATH appropriately.
exit /B 1
)
@@ -163,19 +177,6 @@ if not defined CLASSPATH (
goto :eof
rem ----------------------------------------------------------------------
-rem CALL subroutine that prepares to use the embedded JRE
-rem ----------------------------------------------------------------------
-
-:prepare_embedded_jre
-set RHQ_CLI_JAVA_HOME=%RHQ_CLI_HOME%\jre
-if defined RHQ_CLI_DEBUG echo Using the embedded JRE
-if not exist "%RHQ_CLI_JAVA_HOME%" (
- if defined RHQ_CLI_DEBUG echo No embedded JRE found - will try to use JAVA_HOME:
%JAVA_HOME%
- set RHQ_CLI_JAVA_HOME=%JAVA_HOME%
-)
-goto :eof
-
-rem ----------------------------------------------------------------------
rem CALL subroutine that exits this script normally
rem ----------------------------------------------------------------------
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-installer.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-installer.bat
index 2b95d74c..d2c554c 100644
---
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-installer.bat
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-installer.bat
@@ -47,7 +47,7 @@ rem If the embedded JRE is to be used but is not available, the
fallback
rem JRE to be used will be determined by the JAVA_HOME environment variable.
rem ===========================================================================
-setlocal
+setlocal enabledelayedexpansion
rem if debug variable is set, it is assumed to be on, unless its value is false
if "%RHQ_SERVER_DEBUG%" == "false" (
@@ -80,23 +80,23 @@ rem
----------------------------------------------------------------------
if not defined RHQ_JAVA_EXE_FILE_PATH (
if defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_SERVER_JAVA_EXE_FILE_PATH!
)
)
if not defined RHQ_JAVA_HOME (
if defined RHQ_SERVER_JAVA_HOME (
- set RHQ_JAVA_HOME=%RHQ_SERVER_JAVA_HOME%
+ set RHQ_JAVA_HOME=!RHQ_SERVER_JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
if not defined RHQ_JAVA_HOME (
- if defined RHQ_SERVER_DEBUG echo No RHQ JAVA property set, defaulting to JAVA_HOME:
%JAVA_HOME%
- set RHQ_JAVA_HOME=%JAVA_HOME%
+ if defined RHQ_SERVER_DEBUG echo No RHQ JAVA property set, defaulting to JAVA_HOME:
!JAVA_HOME!
+ set RHQ_JAVA_HOME=!JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_JAVA_HOME%\bin\java.exe
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_JAVA_HOME!\bin\java.exe
)
if defined RHQ_SERVER_DEBUG echo RHQ_JAVA_HOME: %RHQ_JAVA_HOME%
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-server.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-server.bat
index a8a70ff..ba6cbd8 100644
---
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-server.bat
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-server.bat
@@ -58,7 +58,7 @@ rem
rem This script does not use the built-in JBossAS run.bat.
rem ===========================================================================
-setlocal
+setlocal enabledelayedexpansion
rem if debug variable is set, it is assumed to be on, unless its value is false
if "%RHQ_SERVER_DEBUG%" == "false" (
@@ -91,23 +91,23 @@ rem
----------------------------------------------------------------------
if not defined RHQ_JAVA_EXE_FILE_PATH (
if defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_SERVER_JAVA_EXE_FILE_PATH!
)
)
if not defined RHQ_JAVA_HOME (
if defined RHQ_SERVER_JAVA_HOME (
- set RHQ_JAVA_HOME=%RHQ_SERVER_JAVA_HOME%
+ set RHQ_JAVA_HOME=!RHQ_SERVER_JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
if not defined RHQ_JAVA_HOME (
- if defined RHQ_SERVER_DEBUG echo No RHQ JAVA property set, defaulting to JAVA_HOME:
%JAVA_HOME%
- set RHQ_JAVA_HOME=%JAVA_HOME%
+ if defined RHQ_SERVER_DEBUG echo No RHQ JAVA property set, defaulting to JAVA_HOME:
!JAVA_HOME!
+ set RHQ_JAVA_HOME=!JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_JAVA_HOME%\bin\java.exe
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_JAVA_HOME!\bin\java.exe
)
if defined RHQ_SERVER_DEBUG echo RHQ_JAVA_HOME: %RHQ_JAVA_HOME%
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage-installer.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage-installer.bat
index 6f97385..f29b7c9 100644
---
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage-installer.bat
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage-installer.bat
@@ -50,7 +50,7 @@ rem left unset if it is not needed.
rem
rem =============================================================================
-setlocal
+setlocal enabledelayedexpansion
rem if debug variable is set, it is assumed to be on, unless its value is false
if "%RHQ_STORAGE_DEBUG%" == "false" (
@@ -135,23 +135,23 @@ rem
----------------------------------------------------------------------
if not defined RHQ_JAVA_EXE_FILE_PATH (
if defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_SERVER_JAVA_EXE_FILE_PATH!
)
)
if not defined RHQ_JAVA_HOME (
if defined RHQ_SERVER_JAVA_HOME (
- set RHQ_JAVA_HOME=%RHQ_SERVER_JAVA_HOME%
+ set RHQ_JAVA_HOME=!RHQ_SERVER_JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
if not defined RHQ_JAVA_HOME (
- if defined RHQ_STORAGE_DEBUG echo No RHQ JAVA property set, defaulting to
JAVA_HOME: %JAVA_HOME%
- set RHQ_JAVA_HOME=%JAVA_HOME%
+ if defined RHQ_STORAGE_DEBUG echo No RHQ JAVA property set, defaulting to
JAVA_HOME: !JAVA_HOME!
+ set RHQ_JAVA_HOME=!JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_JAVA_HOME%\bin\java.exe
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_JAVA_HOME!\bin\java.exe
)
if defined RHQ_STORAGE_DEBUG echo RHQ_JAVA_HOME: %RHQ_JAVA_HOME%
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage.bat
index 7560932..c2f7f02 100644
---
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage.bat
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/internal/rhq-storage.bat
@@ -60,7 +60,7 @@ rem
rem This script does not use the built-in cassandra.bat.
rem ===========================================================================
-setlocal
+setlocal enabledelayedexpansion
rem if debug variable is set, it is assumed to be on, unless its value is false
if "%RHQ_STORAGE_DEBUG%" == "false" (
@@ -111,23 +111,23 @@ rem
----------------------------------------------------------------------
if not defined RHQ_JAVA_EXE_FILE_PATH (
if defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_SERVER_JAVA_EXE_FILE_PATH!
)
)
if not defined RHQ_JAVA_HOME (
if defined RHQ_SERVER_JAVA_HOME (
- set RHQ_JAVA_HOME=%RHQ_SERVER_JAVA_HOME%
+ set RHQ_JAVA_HOME=!RHQ_SERVER_JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
if not defined RHQ_JAVA_HOME (
- if defined RHQ_STORAGE_DEBUG echo No RHQ JAVA property set, defaulting to
JAVA_HOME: %JAVA_HOME%
- set RHQ_JAVA_HOME=%JAVA_HOME%
+ if defined RHQ_STORAGE_DEBUG echo No RHQ JAVA property set, defaulting to
JAVA_HOME: !JAVA_HOME!
+ set RHQ_JAVA_HOME=!JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_JAVA_HOME%\bin\java.exe
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_JAVA_HOME!\bin\java.exe
)
if defined RHQ_STORAGE_DEBUG echo RHQ_JAVA_HOME: %RHQ_JAVA_HOME%
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-data-migration.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-data-migration.bat
index 844495d..7976b98 100644
---
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-data-migration.bat
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-data-migration.bat
@@ -50,7 +50,7 @@ rem left unset if it is not needed.
rem
rem =============================================================================
-setlocal
+setlocal enabledelayedexpansion
rem if debug variable is set, it is assumed to be on, unless its value is false
if "%RHQ_DATA_MIGRATION_DEBUG%" == "false" (
@@ -135,23 +135,23 @@ rem
----------------------------------------------------------------------
if not defined RHQ_JAVA_EXE_FILE_PATH (
if defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_SERVER_JAVA_EXE_FILE_PATH!
)
)
if not defined RHQ_JAVA_HOME (
if defined RHQ_SERVER_JAVA_HOME (
- set RHQ_JAVA_HOME=%RHQ_SERVER_JAVA_HOME%
+ set RHQ_JAVA_HOME=!RHQ_SERVER_JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
if not defined RHQ_JAVA_HOME (
- if defined RHQ_DATA_MIGRATION_DEBUG echo No RHQ JAVA property set, defaulting to
JAVA_HOME: %JAVA_HOME%
- set RHQ_JAVA_HOME=%JAVA_HOME%
+ if defined RHQ_DATA_MIGRATION_DEBUG echo No RHQ JAVA property set, defaulting to
JAVA_HOME: !JAVA_HOME!
+ set RHQ_JAVA_HOME=!JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_JAVA_HOME%\bin\java.exe
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_JAVA_HOME!\bin\java.exe
)
if defined RHQ_DATA_MIGRATION_DEBUG echo RHQ_JAVA_HOME: %RHQ_JAVA_HOME%
diff --git a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.bat
index 6a611e4..8d16ceb 100644
--- a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.bat
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.bat
@@ -49,7 +49,7 @@ rem left unset if it is not
needed.
rem =============================================================================
-setlocal
+setlocal enabledelayedexpansion
rem if debug variable is set, it is assumed to be on, unless its value is false
if "%RHQ_CONTROL_DEBUG%" == "false" (
@@ -134,23 +134,23 @@ rem
----------------------------------------------------------------------
if not defined RHQ_JAVA_EXE_FILE_PATH (
if defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_SERVER_JAVA_EXE_FILE_PATH!
)
)
if not defined RHQ_JAVA_HOME (
if defined RHQ_SERVER_JAVA_HOME (
- set RHQ_JAVA_HOME=%RHQ_SERVER_JAVA_HOME%
+ set RHQ_JAVA_HOME=!RHQ_SERVER_JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
if not defined RHQ_JAVA_HOME (
- if defined RHQ_CONTROL_DEBUG echo No RHQ JAVA property set, defaulting to
JAVA_HOME: %JAVA_HOME%
- set RHQ_JAVA_HOME=%JAVA_HOME%
+ if defined RHQ_CONTROL_DEBUG echo No RHQ JAVA property set, defaulting to
JAVA_HOME: !JAVA_HOME!
+ set RHQ_JAVA_HOME=!JAVA_HOME!
)
)
if not defined RHQ_JAVA_EXE_FILE_PATH (
- set RHQ_JAVA_EXE_FILE_PATH=%RHQ_JAVA_HOME%\bin\java.exe
+ set RHQ_JAVA_EXE_FILE_PATH=!RHQ_JAVA_HOME!\bin\java.exe
)
if defined RHQ_CONTROL_DEBUG echo RHQ_JAVA_HOME: %RHQ_JAVA_HOME%
@@ -178,8 +178,7 @@ if defined RHQ_CONTROL_DEBUG (
set _RHQ_LOGLEVEL=INFO
)
-rem debugging the logging level now for development/testing
-rem debugging the logging level now for development/testing
+rem Set some of the base required options
set RHQ_CONTROL_JAVA_OPTS=%RHQ_CONTROL_JAVA_OPTS% -Djava.awt.headless=true
-Drhq.server.properties-file="%RHQ_SERVER_HOME%\bin\rhq-server.properties"
-Drhq.control.logdir="%RHQ_SERVER_HOME%\logs"
-Drhq.control.loglevel=%_RHQ_LOGLEVEL% -Drhq.server.basedir="%RHQ_SERVER_HOME%"
-Drhqctl.properties-file="%RHQ_SERVER_HOME%\bin\rhqctl.properties"
-Drhq.java-exe-file-path="%RHQ_JAVA_EXE_FILE_PATH%"
rem Sample JPDA settings for remote socket debugging
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.inc
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.inc
new file mode 100644
index 0000000..ffef3ce
--- /dev/null
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-server-wrapper.inc
@@ -0,0 +1,19 @@
+#*****************************************************************************
+# RHQ Server Java Service Wrapper Settings Include File
+#
+# This file specifies a set of additional environment variables that will be
+# applied to the RHQ Server JVM. This file will likely be empty.
+#
+# If adding additional Java properties note that the properties must follow
+# a strict number ordering (that continues from rhq-server-wrapper.conf)
+# and currently must start with:
+#
+# wrapper.java.additional.23=
+#
+# For example, to set a non-default temp directory for Java:
+# Note: use forward slashes for directories:
+#
+# wrapper.java.additional.23="-Djava.io.tmpdir=c:/temp"
+#
+#*****************************************************************************
+
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.env
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.env
index 1441e0a..ff0cb19 100644
---
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.env
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.env
@@ -2,15 +2,21 @@
# RHQ Storage Node Java Service Wrapper Environment Settings File
#
# This file specifies a set of environment variables that will be
-# applied to the Storage Node JVM.
+# applied to the RHQ Storage Node JVM.
#
-# THIS FILE SHOULD NOT BE EDITED!
+#*****************************************************************************
+
+
+#*****************************************************************************
+# MANAGED SETTINGS
#
-# This file represents the values managed as RHQ Storage Node resource
+# This section represents the values managed as RHQ Storage Node resource
# configuration values. Or, set by the installer.
#
+# DO NOT EDIT THESE VALUES BY HAND. Changes should be performed via
+# the Administration section of the RHQ GUI.
+#
#*****************************************************************************
-
set.jmx_port=7299
set.heap_min=-Xms512M
@@ -22,3 +28,14 @@ set.thread_stack_size=-Xss180k
set.heap_dump_on_OOMError=-XX:+HeapDumpOnOutOfMemoryError
set.heap_dump_dir=
+
+
+#*****************************************************************************
+# CUSTOM SETTINGS
+#
+# This section if for additional properties managed by the user. In general
+# there will be nothing defined in this section. More likely any customization
+# of what is set in the rhq-storage-wrapper.conf would be located in the
+# rhq-storage-wrapper.inc file. See that file for more information.
+#
+#*****************************************************************************
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.inc
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.inc
new file mode 100644
index 0000000..ef5aa09
--- /dev/null
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.inc
@@ -0,0 +1,19 @@
+#*****************************************************************************
+# RHQ Storage Node Java Service Wrapper Settings Include File
+#
+# This file specifies a set of additional environment variables that will be
+# applied to the RHQ Storage Node JVM. This file will likely be empty.
+#
+# If adding additional Java properties note that the properties must follow
+# a strict number ordering (that continues from rhq-storage-wrapper.conf)
+# and currently must start with:
+#
+# wrapper.java.additional.21=
+#
+# For example, to set a non-default temp directory for Java:
+# Note: use forward slashes for directories:
+#
+# wrapper.java.additional.21="-Djava.io.tmpdir=c:/temp"
+#
+#*****************************************************************************
+
diff --git
a/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
b/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
index 8cd24ee..d883571 100644
---
a/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
+++
b/modules/enterprise/server/appserver/src/main/dev-resources/bin/wrapper/rhq-server-wrapper.inc
@@ -3,13 +3,19 @@
# last wrapper.java.additional.N entry in rhq-server-wrapper.conf.
#
+# reduce memory needs for dev env.
+wrapper.java.additional.23=-Xms512M
+wrapper.java.additional.24=-Xmx512M
+wrapper.java.additional.25=-XX:PermSize=200M
+wrapper.java.additional.26=-XX:MaxPermSize=200M
+
# enable remote debugging
-wrapper.java.additional.23=-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
+wrapper.java.additional.27=-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n
# enable jprofiler
#set.PATH=%PATH%;<jprofiler-install-dir>\bin\windows
-#wrapper.java.additional.24=-agentlib:jprofilerti=port=8849
-#wrapper.java.additional.25=-Xbootclasspath/a:<jprofiler-install-dir>\bin\agent.jar
+#wrapper.java.additional.28=-agentlib:jprofilerti=port=8849
+#wrapper.java.additional.29=-Xbootclasspath/a:<jprofiler-install-dir>\bin\agent.jar
# disable JVM startup timeout
wrapper.startup.timeout=0
diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
index 67eff91..ae1a184 100644
--- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
+++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml
@@ -1008,7 +1008,7 @@
${comment}rhq.storage.verify-data-dirs-empty=${rhq.storage.verify-data-dirs-empt
<target name="copy-dev-resources" if="copy.dev.resources">
<echo>Copying dev-only resources ...</echo>
- <copy todir="${project.build.outputDirectory}"
verbose="true">
+ <copy todir="${project.build.outputDirectory}"
overwrite="true" verbose="true">
<fileset dir="src/main/dev-resources" />
</copy>
<loadproperties>