.classpath
| 22
etc/eclipse-tools/RHQ
| 1
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
| 2
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/deploy.xml
| 2
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
| 4
modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
| 2
modules/common/cassandra-installer/pom.xml
| 58 ++
modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
| 225 ++++++---
modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
| 6
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-installer.bat
| 2
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.bat
| 48 -
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
| 18
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-storage-installer.bat
| 199 ++++++++
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-storage.bat
| 232 +++++++++
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl
| 241 ++++++++++
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.bat
| 193 ++++++++
modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.sh
| 241 ----------
modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.conf
| 202 ++++++++
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
| 34 -
modules/enterprise/server/server-control/pom.xml
| 58 ++
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
| 40 +
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
| 4
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Console.java
| 63 +-
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
| 156 ++++--
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
| 21
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
| 21
modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Stop.java
| 24
27 files changed, 1588 insertions(+), 531 deletions(-)
New commits:
commit 4c6fb2d7667bd2605f2a07f1fcddd785c36ea07c
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 26 17:30:23 2013 -0400
Fix issues in install marker file placement.
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index 50dad87..b68cf12 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -1237,12 +1237,11 @@ public class InstallerServiceImpl implements InstallerService {
}
private void writeInstalledFileMarker() throws Exception {
- File basedir = new File(getAppServerDataDir());
- File standalonedir = new File(basedir, "jbossas/standalone");
- if (!standalonedir.isDirectory()) {
- throw new IOException("Directory Not Found: [" +
standalonedir.getPath() + "]");
+ File datadir = new File(getAppServerDataDir());
+ if (!datadir.isDirectory()) {
+ throw new IOException("Directory Not Found: [" + datadir.getPath()
+ "]");
}
- File markerFile = new File(standalonedir, "data/rhq.installed");
+ File markerFile = new File(datadir, "rhq.installed");
markerFile.createNewFile();
}
}
commit f293cea87eb89c77749118c4fac49b6eb52fbd73
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 26 17:23:21 2013 -0400
On windows default the cassandra data to HOMEDRIVE:/rhq/storage/...
diff --git
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index c123b96..ce63dff 100644
---
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -100,11 +100,13 @@ public class StorageInstaller {
private File logDir;
- private String commitLogDir = "/var/lib/rhq/storage/commitlog";
+ private String dirPrefix = (isWindows()) ? "" : "var/lib";
- private String dataDir = "/var/lib/rhq/storage/data";
+ private String commitLogDir = dirPrefix + "/rhq/storage/commitlog";
- private String savedCachesDir = "/var/lib/rhq/storage/saved_caches";
+ private String dataDir = dirPrefix + "/rhq/storage/data";
+
+ private String savedCachesDir = dirPrefix + "/rhq/storage/saved_caches";
public StorageInstaller() {
String basedir = System.getProperty("rhq.server.basedir");
commit 86a0d9ae8c8aaf13d0dd8f51e6e3a8b0f8678067
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 26 15:02:39 2013 -0400
Working towards rhqctl install support on windows...
diff --git
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index dd53968..50dad87 100644
---
a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++
b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -19,9 +19,7 @@
package org.rhq.enterprise.server.installer;
import java.io.File;
-import java.io.FileWriter;
import java.io.IOException;
-import java.io.StringReader;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.HashMap;
@@ -42,7 +40,6 @@ import org.rhq.common.jbossas.client.controller.WebJBossASClient;
import org.rhq.core.db.DatabaseTypeFactory;
import org.rhq.core.util.PropertiesFileUpdate;
import org.rhq.core.util.exception.ThrowableUtil;
-import org.rhq.core.util.stream.StreamUtil;
import org.rhq.enterprise.server.installer.ServerInstallUtil.ExistingSchemaOption;
import org.rhq.enterprise.server.installer.ServerInstallUtil.SupportedDatabaseType;
@@ -482,8 +479,8 @@ public class InstallerServiceImpl implements InstallerService {
if (cassandraSchemaManager.schemaExists()) {
log("Cassandra schema exists.");
if (ExistingSchemaOption.OVERWRITE == existingSchemaOptionEnum) {
- log("Cassandra schema exists but installer was told to
overwrite it - a new schema will be " +
- "created now.");
+ log("Cassandra schema exists but installer was told to
overwrite it - a new schema will be "
+ + "created now.");
cassandraSchemaManager.dropSchema();
cassandraSchemaManager.createSchema();
@@ -784,6 +781,18 @@ public class InstallerServiceImpl implements InstallerService {
}
}
+ private String getAppServerDataDir() throws Exception {
+ ModelControllerClient mcc = null;
+ try {
+ mcc = getModelControllerClient();
+ final CoreJBossASClient client = new CoreJBossASClient(mcc);
+ final String dir = client.getAppServerDataDir();
+ return dir;
+ } finally {
+ safeClose(mcc);
+ }
+ }
+
private String getAppServerConfigDir() throws Exception {
ModelControllerClient mcc = null;
try {
@@ -1227,13 +1236,13 @@ public class InstallerServiceImpl implements InstallerService {
return new SchemaManager(username, password, hosts);
}
- private void writeInstalledFileMarker() throws IOException {
- File basedir = new File(System.getProperty("rhq.server.basedir"));
- File modulesDir = new File(basedir, "modules");
- File metaInfDir = new File(modulesDir,
-
"org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/META-INF/");
- File markerFile = new File(metaInfDir, ".installed");
-
- StreamUtil.copy(new StringReader(""), new FileWriter(markerFile));
+ private void writeInstalledFileMarker() throws Exception {
+ File basedir = new File(getAppServerDataDir());
+ File standalonedir = new File(basedir, "jbossas/standalone");
+ if (!standalonedir.isDirectory()) {
+ throw new IOException("Directory Not Found: [" +
standalonedir.getPath() + "]");
+ }
+ File markerFile = new File(standalonedir, "data/rhq.installed");
+ markerFile.createNewFile();
}
}
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
index d64cfed..851dd2d 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
@@ -26,13 +26,11 @@
package org.rhq.server.control;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
-import java.util.Properties;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
@@ -45,7 +43,6 @@ import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.rhq.core.util.PropertiesFileUpdate;
import org.rhq.core.util.stream.StreamUtil;
/**
@@ -146,10 +143,7 @@ public abstract class ControlCommand {
}
protected boolean isServerInstalled() {
- File modulesDir = new File(basedir, "modules");
- File metaInfDir = new File(modulesDir,
-
"org/rhq/rhq-enterprise-server-startup-subsystem/main/deployments/rhq.ear/META-INF/");
- File markerFile = new File(metaInfDir, ".installed");
+ File markerFile = new File(basedir,
"jbossas/standalone/data/rhq.installed");
return markerFile.exists();
}
@@ -224,7 +218,7 @@ public abstract class ControlCommand {
result = new org.apache.commons.exec.CommandLine("cmd.exe");
result.addArgument("/C");
result.addArgument(scriptName + ".bat");
- return result;
+
} else {
result = new org.apache.commons.exec.CommandLine("./" + scriptName
+ ".sh");
}
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
index c5c871d..4970a2a 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
@@ -334,17 +334,35 @@ public class Install extends ControlCommand {
}
private void startRHQServerForInstallation() throws Exception {
- org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-server", "start");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(binDir);
executor.setStreamHandler(new PumpStreamHandler());
+ org.apache.commons.exec.CommandLine commandLine;
- executor.execute(commandLine, new DefaultExecuteResultHandler());
+ if (isWindows()) {
+ // For windows we will [re-]install the server as a windows service, then
start the service.
+
+ commandLine = getCommandLine("rhq-server", "stop");
+ executor.execute(commandLine);
+
+ commandLine = getCommandLine("rhq-server", "remove");
+ executor.execute(commandLine);
+
+ commandLine = getCommandLine("rhq-server", "install");
+ executor.execute(commandLine);
+
+ commandLine = getCommandLine("rhq-server", "start");
+ executor.execute(commandLine);
+ } else {
+ // For *nix, just start the server in the background
+ commandLine = getCommandLine("rhq-server", "start");
+ executor.execute(commandLine, new DefaultExecuteResultHandler());
+ }
+
+ // Wait for the server to complete it's startup
commandLine = getCommandLine("rhq-installer", "--test");
- executor = new DefaultExecutor();
- executor.setWorkingDirectory(binDir);
int exitCode = executor.execute(commandLine);
while (exitCode != 0) {
@@ -371,15 +389,30 @@ public class Install extends ControlCommand {
private boolean isRHQServerInitialized() throws Exception {
File logDir = new File(basedir, "logs");
- BufferedReader reader = new BufferedReader(new FileReader(new File(logDir,
"server.log")));
- String line = reader.readLine();
- while (line != null) {
- if (line.contains("Server started")) {
- return true;
+
+ BufferedReader reader = null;
+
+ try {
+ reader = new BufferedReader(new FileReader(new File(logDir,
"server.log")));
+ String line = reader.readLine();
+ while (line != null) {
+ if (line.contains("Server started")) {
+ return true;
+ }
+ line = reader.readLine();
+ }
+
+ return false;
+
+ } finally {
+ if (null != reader) {
+ try {
+ reader.close();
+ } catch (Exception e) {
+ // best effort
+ }
}
- line = reader.readLine();
}
- return false;
}
private void installAgent(File agentBasedir) throws Exception {
commit c2aedee12d71d14d8987993b524d5071e87aba66
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 26 15:01:33 2013 -0400
fix a small issue in the rhq-installer.bat
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-installer.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-installer.bat
index 811aa17..2f69194 100644
--- a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-installer.bat
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-installer.bat
@@ -120,7 +120,7 @@ if not defined RHQ_SERVER_DEBUG set _RHQ_LOGLEVEL=INFO
set RHQ_SERVER_INSTALLER_JAVA_OPTS=%RHQ_SERVER_INSTALLER_JAVA_OPTS%
-Djava.awt.headless=true -Di18nlog.logger-type=commons
-Drhq.server.properties-file=%RHQ_SERVER_HOME%\bin\rhq-server.properties
-Drhq.server.installer.logdir=%RHQ_SERVER_HOME%\logs
-Drhq.server.installer.loglevel=%_RHQ_LOGLEVEL%
rem Sample JPDA settings for remote socket debugging
-rem RHQ_SERVER_INSTALLER_JAVA_OPTS=%RHQ_SERVER_INSTALLER_JAVA_OPTS%
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
+rem set RHQ_SERVER_INSTALLER_JAVA_OPTS=%RHQ_SERVER_INSTALLER_JAVA_OPTS%
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
if defined RHQ_SERVER_DEBUG echo RHQ_SERVER_INSTALLER_JAVA_OPTS:
%RHQ_SERVER_INSTALLER_JAVA_OPTS%
if defined RHQ_SERVER_DEBUG echo RHQ_SERVER_INSTALLER_ADDITIONAL_JAVA_OPTS:
%RHQ_SERVER_INSTALLER_ADDITIONAL_JAVA_OPTS%
commit 23e651bd2a7381e41ffb364aead5a0e409a039bb
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 26 15:01:00 2013 -0400
this is a manual cherry-pick of a master commit addinga convenience method
to the ASClient.
diff --git
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
index 4521b35..7d7095d 100644
---
a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
+++
b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/CoreJBossASClient.java
@@ -92,6 +92,12 @@ public class CoreJBossASClient extends JBossASClient {
return dir;
}
+ public String getAppServerDataDir() throws Exception {
+ final String[] address = { CORE_SERVICE, SERVER_ENVIRONMENT };
+ final String dir = getStringAttribute(true, "data-dir",
Address.root().add(address));
+ return dir;
+ }
+
public String getAppServerBaseDir() throws Exception {
final String[] address = { CORE_SERVICE, SERVER_ENVIRONMENT };
final String dir = getStringAttribute(true, "base-dir",
Address.root().add(address));
commit 5e4c9fb7fea8339953b084ca117f3975d9deb635
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 26 13:23:39 2013 -0400
The cassandra log filename was huge, I don't think we want the whole path
in the name, do we?
diff --git
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index 5a20097..c123b96 100644
---
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -211,7 +211,8 @@ public class StorageInstaller {
deploymentOptions.setCommitLogDir(commitLogDir);
deploymentOptions.setDataDir(dataDir);
deploymentOptions.setSavedCachesDir(savedCachesDir);
- deploymentOptions.setLogFileName(logFile.getPath());
+ // deploymentOptions.setLogFileName(logFile.getPath());
+ deploymentOptions.setLogFileName(logFile.getName());
deploymentOptions.setLoggingLevel("INFO");
deploymentOptions.setRpcPort(rpcPort);
deploymentOptions.setJmxPort(getPort(cmdLine, "jmx-port",
jmxPort));
commit bdb8fe4fccab4cb81fd8d3026ec988bcbb9cd9cf
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 26 13:22:32 2013 -0400
Fix property name typo
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
index 6ed76a5..23218ca 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/cassandra/conf/rhq.cassandra.yaml
@@ -335,7 +335,7 @@ native_transport_port: ${rhq.cassandra.native_transport_port}
# rpc_min_threads and rpc_max_threads, though the default differ slightly and
# are the ones below:
# native_transport_min_threads: 16
-native_transport_max_threads: ${rhq.casandra.native_transport_max_threads}
+native_transport_max_threads: ${rhq.cassandra.native_transport_max_threads}
# Whether to start the thrift rpc server.
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
index ce1df3a..e17520d 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/resources/cassandra.properties
@@ -42,7 +42,7 @@ rhq.cassandra.listen.address=localhost
rhq.cassandra.rpc.address=localhost
# The maximum number of threads handling native CQL requests.
-rhq.casandra.native-transport-max-threads=64
+rhq.cassandra.native-transport-max-threads=64
# The port for the CQL native transport to listen for clients on.
rhq.cassandra.native-transport-port=9042
commit 1416cd575dee66ef46cf9166d4dddc8b2916ab0f
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Apr 26 13:21:26 2013 -0400
More eclipse tweeks
diff --git a/.classpath b/.classpath
index d2d09be..8010bae 100644
--- a/.classpath
+++ b/.classpath
@@ -384,5 +384,8 @@
<classpathentry kind="var"
path="M2_REPO/org/eclipse/jetty/aggregate/jetty-all/8.1.8.v20121106/jetty-all-8.1.8.v20121106.jar"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="var"
path="JDK_HOME/lib/tools.jar"/>
+ <classpathentry exported="true" kind="var"
path="JDK_HOME/jre/lib/rt.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/commons-configuration/commons-configuration/1.6/commons-configuration-1.6.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/apache/maven/plugin-tools/maven-plugin-annotations/3.2/maven-plugin-annotations-3.2.jar"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
diff --git a/etc/eclipse-tools/RHQ Remote Debugging - Test.launch b/etc/eclipse-tools/RHQ
Remote Debugging - Test.launch
index 7b57371..971736b 100644
--- a/etc/eclipse-tools/RHQ Remote Debugging - Test.launch
+++ b/etc/eclipse-tools/RHQ Remote Debugging - Test.launch
@@ -15,7 +15,6 @@
<mapAttribute key="org.eclipse.jdt.launching.CONNECT_MAP">
<mapEntry key="hostname" value="localhost"/>
<mapEntry key="port" value="8797"/>
-<mapEntry key="timeout" value="20000"/>
</mapAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR"
value="rhq"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_CONNECTOR_ID"
value="org.eclipse.jdt.launching.socketAttachConnector"/>
commit ba2cb5b68412c47e2ff2bdae0f0055ca7a86c0f6
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Apr 24 16:13:24 2013 -0400
- handle executor command lines for windows
- use windows service for hosting cassandra
- use tanuki java service wrapper and introduce rhq-storage.bat, analogous to
rhq-server.bat. And rhq-storage-wrapper.conf.
- change rhqctl.sh to rhqctl
- log exception cause for RHQControl
- add rhqctl.bat and rhq-storage-installer.bat for windows , to match
rhqctl and rhq-storage-installer.sh
- storage installer changes for windows and some fixes
- some fixes to rhq-server.sh|bat scripts
- come .classpath changes for eclipse
diff --git a/.classpath b/.classpath
index 86c5ab2..d2d09be 100644
--- a/.classpath
+++ b/.classpath
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src"
path="modules/common/ant-bundle/src/main/java"/>
+ <classpathentry kind="src"
path="modules/common/cassandra-ccm/cassandra-ccm-maven-plugin/src/main/java"/>
+ <classpathentry kind="src"
path="modules/common/cassandra-ccm/cassandra-ccm-core/src/test/java"/>
+ <classpathentry kind="src"
path="modules/common/cassandra-ccm/cassandra-ccm-arquillian/src/main/java"/>
+ <classpathentry kind="src"
path="modules/common/cassandra-installer/src/main/java"/>
+ <classpathentry kind="src"
path="modules/enterprise/server/server-control/src/main/java"/>
<classpathentry kind="src"
path="modules/enterprise/server/jar/src/test/java"/>
<classpathentry kind="src"
path="modules/enterprise/server/itests-2/src/test/java"/>
<classpathentry kind="src"
path="modules/enterprise/scripting/javascript/src/main/java"/>
@@ -361,12 +366,11 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/org/python/jython-standalone/2.5.2/jython-standalone-2.5.2.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/com/wordnik/swagger-annotations_2.9.1/1.1.1-SNAPSHOT/swagger-annotations_2.9.1-1.1.1-20121031.024335-6.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/joda-time/joda-time/2.1/joda-time-2.1.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/byteman/byteman-install/1.5.2/byteman-install-1.5.2.jar"
sourcepath="M2_REPO/org/jboss/byteman/byteman-install/1.5.2/byteman-install-1.5.2-sources.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/byteman/byteman-submit/1.5.2/byteman-submit-1.5.2.jar"
sourcepath="M2_REPO/org/jboss/byteman/byteman-submit/1.5.2/byteman-submit-1.5.2-sources.jar"/>
- <classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/byteman/byteman-bmunit/1.5.2/byteman-bmunit-1.5.2.jar"
sourcepath="M2_REPO/org/jboss/byteman/byteman-bmunit/1.5.2/byteman-bmunit-1.5.2-sources.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/apache/cassandra/cassandra-thrift/1.2.0-beta2/cassandra-thrift-1.2.0-beta2.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/byteman/byteman-install/1.5.2/byteman-install-1.5.2.jar"
sourcepath="M2_REPO/org/jboss/byteman/byteman-install/1.5.2/byteman-install-1.5.2-sources.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/byteman/byteman-submit/1.5.2/byteman-submit-1.5.2.jar"
sourcepath="M2_REPO/org/jboss/byteman/byteman-submit/1.5.2/byteman-submit-1.5.2-sources.jar"/>
+ <classpathentry exported="true" kind="var"
path="M2_REPO/org/jboss/byteman/byteman-bmunit/1.5.2/byteman-bmunit-1.5.2.jar"
sourcepath="M2_REPO/org/jboss/byteman/byteman-bmunit/1.5.2/byteman-bmunit-1.5.2-sources.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/hectorclient/hector-core/1.1-1/hector-core-1.1-1.jar"/>
- <classpathentry kind="var"
path="M2_REPO/org/apache/cassandra/cassandra-all/1.2.0-beta2/cassandra-all-1.2.0-beta2.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/apache/cassandra/cassandra-all/1.2.2/cassandra-all-1.2.2.jar"/>
<classpathentry kind="var"
path="M2_REPO/com/datastax/cassandra/cassandra-driver-core/1.0.0-beta2-rhq-1.2.2-2/cassandra-driver-core-1.0.0-beta2-rhq-1.2.2-2.jar"/>
<classpathentry kind="var"
path="M2_REPO/org/apache/thrift/libthrift/0.7.0/libthrift-0.7.0.jar"/>
<classpathentry kind="var"
path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar"/>
@@ -375,5 +379,10 @@
<classpathentry exported="true" kind="var"
path="M2_REPO/org/apache/xmlgraphics/batik-util/1.7/batik-util-1.7.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/apache/xmlgraphics/batik-svg-dom/1.7/batik-svg-dom-1.7.jar"/>
<classpathentry exported="true" kind="var"
path="M2_REPO/org/apache/xmlgraphics/batik-dom/1.7/batik-dom-1.7.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/apache/cassandra/cassandra-thrift/1.2.2/cassandra-thrift-1.2.2.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/apache/commons/commons-exec/1.1/commons-exec-1.1.jar"/>
+ <classpathentry kind="var"
path="M2_REPO/org/eclipse/jetty/aggregate/jetty-all/8.1.8.v20121106/jetty-all-8.1.8.v20121106.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry exported="true" kind="var"
path="JDK_HOME/lib/tools.jar"/>
<classpathentry kind="output" path="eclipse-classes"/>
</classpath>
diff --git
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
index ae2869b..5a20097 100644
---
a/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
+++
b/modules/common/cassandra-installer/src/main/java/org/rhq/storage/installer/StorageInstaller.java
@@ -28,6 +28,7 @@ package org.rhq.storage.installer;
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
+import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -111,68 +112,62 @@ public class StorageInstaller {
storageBasedir = new File(basedir, "rhq-storage");
logDir = new File(serverBasedir, "logs");
- Option hostname = new Option("n", "hostname", true, "The
hostname or IP address on which the node will listen for " +
- "requests. If not specified, defaults to the hostname for
localhost.");
- hostname.setArgName("HOSTNAME");
+ Option hostname = new Option("n", "hostname", true,
+ "The hostname or IP address on which the node will listen for "
+ + "requests. If not specified, defaults to the hostname for
localhost.");
+ hostname.setArgName("HOSTNAME");
- Option seeds = new Option("s", "seeds", true, "A
comma-delimited list of hostnames or IP addresses that " +
- "serve as contact points. Nodes use this list to find each other and to
learn the cluster topology. " +
- "It does not need to specify all nodes in the cluster. Defaults to this
node's hostname.");
+ Option seeds = new Option("s", "seeds", true, "A
comma-delimited list of hostnames or IP addresses that "
+ + "serve as contact points. Nodes use this list to find each other and
to learn the cluster topology. "
+ + "It does not need to specify all nodes in the cluster. Defaults to
this node's hostname.");
seeds.setArgName("SEEDS");
- Option jmxPortOption = new Option("j", "jmx-port", true,
"The port on which to listen for JMX connections. " +
- "Defaults to " + jmxPort + ".");
+ Option jmxPortOption = new Option("j", "jmx-port", true,
"The port on which to listen for JMX connections. "
+ + "Defaults to " + jmxPort + ".");
jmxPortOption.setArgName("PORT");
- Option nativeTransportPortOption = new Option("c",
"client-port", true, "The port on which to " +
- "listen for client requests. Defaults to " + nativeTransportPort);
+ Option nativeTransportPortOption = new Option("c",
"client-port", true, "The port on which to "
+ + "listen for client requests. Defaults to " +
nativeTransportPort);
nativeTransportPortOption.setArgName("PORT");
- Option storagePortOption = new Option(null, "storage-port", true,
"The port on which to listen for requests " +
- " from other nodes. Defaults to " + storagePort);
+ Option storagePortOption = new Option(null, "storage-port", true,
"The port on which to listen for requests "
+ + " from other nodes. Defaults to " + storagePort);
storagePortOption.setArgName("PORT");
- Option sslStoragePortOption = new Option(null, "ssl-storage-port",
true, "The port on which to listen for " +
- "encrypted requests from other nodes. Only used when encryption is
enabled. Defaults to " + sslStoragePort);
+ Option sslStoragePortOption = new Option(null, "ssl-storage-port",
true, "The port on which to listen for "
+ + "encrypted requests from other nodes. Only used when encryption is
enabled. Defaults to "
+ + sslStoragePort);
sslStoragePortOption.setArgName("PORT");
- Option startOption = new Option(null, "start", true, "Start the
storage node after installing it on disk. " +
- "Defaults to true.");
+ Option startOption = new Option(null, "start", true, "Start the
storage node after installing it on disk. "
+ + "Defaults to true.");
startOption.setArgName("true|false");
- Option checkStatus = new Option(null, "check-status", true, "Check
the node status to verify that it is up " +
- "after starting it. This option is ignored if the start option is not
set. Defaults to true.");
+ Option checkStatus = new Option(null, "check-status", true, "Check
the node status to verify that it is up "
+ + "after starting it. This option is ignored if the start option is not
set. Defaults to true.");
checkStatus.setArgName("true|false");
- Option commitLogOption = new Option(null, "commitlog", true, "The
directory where the storage node keeps " +
- "commit log files. Defaults to " + commitLogDir + ".");
+ Option commitLogOption = new Option(null, "commitlog", true, "The
directory where the storage node keeps "
+ + "commit log files. Defaults to " + commitLogDir +
".");
commitLogOption.setArgName("DIR");
- Option dataDirOption = new Option(null, "data", true, "The
directory where the storage node keeps data files. " +
- "Defaults to " + dataDir + ".");
+ Option dataDirOption = new Option(null, "data", true, "The
directory where the storage node keeps data files. "
+ + "Defaults to " + dataDir + ".");
dataDirOption.setArgName("DIR");
- Option savedCachesDirOption = new Option(null, "saved-caches", true,
"The directory where the storage node " +
- "keeps saved cache files. Defaults to " + savedCachesDir +
".");
+ Option savedCachesDirOption = new Option(null, "saved-caches", true,
"The directory where the storage node "
+ + "keeps saved cache files. Defaults to " + savedCachesDir +
".");
savedCachesDirOption.setArgName("DIR");
- Option basedirOption = new Option(null, "dir", true, "The
directory where the storage node will be installed " +
- "The default directory will be " + storageBasedir);
+ Option basedirOption = new Option(null, "dir", true, "The
directory where the storage node will be installed "
+ + "The default directory will be " + storageBasedir);
- options = new Options()
- .addOption(new Option("h", "help", false, "Show this
message."))
+ options = new Options().addOption(new Option("h", "help",
false, "Show this message."))
.addOption(hostname)
//.addOption(seeds)
- .addOption(jmxPortOption)
- .addOption(startOption)
- .addOption(checkStatus)
- .addOption(commitLogOption)
- .addOption(dataDirOption)
- .addOption(savedCachesDirOption)
- .addOption(nativeTransportPortOption)
- .addOption(storagePortOption)
- .addOption(sslStoragePortOption)
- .addOption(basedirOption);
+
.addOption(jmxPortOption).addOption(startOption).addOption(checkStatus).addOption(commitLogOption)
+
.addOption(dataDirOption).addOption(savedCachesDirOption).addOption(nativeTransportPortOption)
+
.addOption(storagePortOption).addOption(sslStoragePortOption).addOption(basedirOption);
}
public int run(CommandLine cmdLine) throws Exception {
@@ -231,8 +226,8 @@ public class StorageInstaller {
checkPerms(options.getOption("data"), dataDir, errors);
if (!errors.isEmpty()) {
- log.error("Problems have been detected with one or more of the
directories in which the storage " +
- "node will need to store data");
+ log.error("Problems have been detected with one or more of the
directories in which the storage "
+ + "node will need to store data");
for (String error : errors) {
log.error(error);
}
@@ -252,7 +247,7 @@ public class StorageInstaller {
PropertiesFileUpdate serverPropertiesUpdater = getServerProperties();
try {
serverPropertiesUpdater.update("rhq.cassandra.seeds",
getSeedsProperty(seeds));
- } catch (IOException e) {
+ } catch (IOException e) {
throw new RuntimeException("An error occurred while trying to update
RHQ server properties", e);
}
@@ -262,7 +257,7 @@ public class StorageInstaller {
String startupErrors = startNode(deploymentOptions);
if (startupErrors == null) {
boolean checkStatus =
Boolean.parseBoolean(cmdLine.getOptionValue("check-status", "true"));
- if (checkStatus) {
+ if (checkStatus || isWindows()) { // no reliable pid file on windows
if (verifyNodeIsUp(jmxPort, 5, 3000)) {
log.info("RHQ Storage Node is up and running and ready
to service client requests");
log.info("Installation of the storage node has completed
successfully.");
@@ -275,24 +270,24 @@ public class StorageInstaller {
}
} else {
if (isRunning()) {
- log.info("Installation of the storage node is complete.
The node should be up and " +
- "running");
+ log.info("Installation of the storage node is complete.
The node should be up and "
+ + "running");
return STATUS_NO_ERRORS;
} else {
- log.warn("Installation of the storage node is complete,
but the node does not appear to " +
- "be running. No start up errors were reported.
Check the log file at " + logFile +
- " for any other possible errors.");
+ log.warn("Installation of the storage node is complete,
but the node does not appear to "
+ + "be running. No start up errors were reported.
Check the log file at " + logFile
+ + " for any other possible errors.");
return STATUS_STORAGE_NOT_RUNNING;
}
}
} else {
- log.error("The storage node reported the following errors while
trying to start:\n\n" +
- startupErrors + "\n\n");
+ log.error("The storage node reported the following errors while
trying to start:\n\n"
+ + startupErrors + "\n\n");
if (startupErrors.contains("java.net.BindException: Address
already in use")) {
log.error("This error may indicate a conflict for the JMX
port.");
}
- log.error("Please review your configuration for possible sources
of errors such as port " +
- "conflicts or invalid arguments/options passed to the java
executable.");
+ log.error("Please review your configuration for possible sources
of errors such as port "
+ + "conflicts or invalid arguments/options passed to the java
executable.");
log.error("The installer will now exit.");
return STATUS_STORAGE_NOT_RUNNING;
}
@@ -317,9 +312,9 @@ public class StorageInstaller {
} else {
File parent = findParentDir(new File(path));
if (!parent.canWrite()) {
- errors.add("The user running this installer does not appear to have
write permissions to " + parent +
- ". Either make sure that the user running the storage node has
write permissions or use the --" +
- option.getLongOpt() + " to change this value.");
+ errors.add("The user running this installer does not appear to have
write permissions to " + parent
+ + ". Either make sure that the user running the storage node has
write permissions or use the --"
+ + option.getLongOpt() + " to change this value.");
}
}
}
@@ -356,31 +351,98 @@ public class StorageInstaller {
}
private String startNode(DeploymentOptions deploymentOptions) throws Exception {
- File basedir = new File(deploymentOptions.getBasedir());
- File binDir = new File(basedir, "bin");
+ org.apache.commons.exec.CommandLine cmdLine;
+ String errOutput;
- File startScript;
if (isWindows()) {
- startScript = new File(binDir, "cassandra.bat");
+ File basedir = new File(System.getProperty("rhq.server.basedir"));
+ basedir = (null == basedir) ? new
File(deploymentOptions.getBasedir()).getParentFile() : basedir;
+ File binDir = new File(basedir, "bin");
+
+ // First, stop the service if it exists
+ cmdLine = new org.apache.commons.exec.CommandLine("cmd.exe");
+ cmdLine.addArgument("/C");
+ cmdLine.addArgument("rhq-storage.bat");
+ cmdLine.addArgument("stop");
+ errOutput = exec(binDir, cmdLine);
+
+ if (!errOutput.isEmpty()) {
+ return errOutput;
+ }
+
+ // Second, remove it if it exists
+ cmdLine = new org.apache.commons.exec.CommandLine("cmd.exe");
+ cmdLine.addArgument("/C");
+ cmdLine.addArgument("rhq-storage.bat");
+ cmdLine.addArgument("remove");
+ errOutput = exec(binDir, cmdLine);
+
+ if (!errOutput.isEmpty()) {
+ return errOutput;
+ }
+
+ // Third installer the service
+ cmdLine = new org.apache.commons.exec.CommandLine("cmd.exe");
+ cmdLine.addArgument("/C");
+ cmdLine.addArgument("rhq-storage.bat");
+ cmdLine.addArgument("install");
+ errOutput = exec(binDir, cmdLine);
+
+ if (!errOutput.isEmpty()) {
+ return errOutput;
+ }
+
+ // Fourth, start the service
+ cmdLine = new org.apache.commons.exec.CommandLine("cmd.exe");
+ cmdLine.addArgument("/C");
+ cmdLine.addArgument("rhq-storage.bat");
+ cmdLine.addArgument("start");
+ errOutput = exec(binDir, cmdLine);
+
+ if (!errOutput.isEmpty()) {
+ return errOutput;
+ }
+
} else {
- startScript = new File(binDir, "cassandra");
+ File basedir = new File(deploymentOptions.getBasedir());
+ File binDir = new File(basedir, "bin");
+
+ cmdLine = new org.apache.commons.exec.CommandLine("cassandra");
+ cmdLine.addArgument("--PidFile");
+ cmdLine.addArgument("cassandra.pid");
+ errOutput = exec(binDir, cmdLine);
+
+ if (!errOutput.isEmpty()) {
+ return errOutput;
+ }
}
- org.apache.commons.exec.CommandLine cmdLine = new
org.apache.commons.exec.CommandLine(startScript)
- .addArgument("-p")
- .addArgument(new File(binDir, "cassandra.pid").getAbsolutePath());
+ return null;
+ }
+ private String exec(File workingDir, org.apache.commons.exec.CommandLine cmdLine)
throws Exception {
Executor executor = new DefaultExecutor();
- org.apache.commons.io.output.ByteArrayOutputStream buffer =
- new org.apache.commons.io.output.ByteArrayOutputStream();
+ org.apache.commons.io.output.ByteArrayOutputStream buffer = new
org.apache.commons.io.output.ByteArrayOutputStream();
+ NullOutputStream nullOs = new NullOutputStream();
PumpStreamHandler streamHandler = new PumpStreamHandler(new NullOutputStream(),
buffer);
+ executor.setWorkingDirectory(workingDir);
executor.setStreamHandler(streamHandler);
- executor.execute(cmdLine);
+ String result = "";
- if (buffer.size() > 0) {
- return buffer.toString();
+ try {
+ executor.execute(cmdLine);
+ result = buffer.toString();
+
+ } finally {
+ try {
+ buffer.close();
+ nullOs.close();
+ } catch (Exception e) {
+ // best effort
+ }
}
- return null;
+
+ return result;
}
private boolean isWindows() {
@@ -394,7 +456,13 @@ public class StorageInstaller {
}
private boolean verifyNodeIsUp(int jmxPort, int retries, long timeout) throws
Exception {
- String url = "service:jmx:rmi:///jndi/rmi://localhost:" + jmxPort +
"/jmxrmi";
+ String address;
+ try {
+ address = InetAddress.getLocalHost().getHostAddress();
+ } catch (UnknownHostException e) {
+ address = "localhost";
+ }
+ String url = "service:jmx:rmi:///jndi/rmi://" + address + ":"
+ jmxPort + "/jmxrmi";
JMXServiceURL serviceURL = new JMXServiceURL(url);
JMXConnector connector = null;
MBeanServerConnection serverConnection = null;
@@ -405,7 +473,7 @@ public class StorageInstaller {
} catch (InterruptedException e) {
}
- Map<String, String> env = new HashMap<String, String>();
+ Map<String, String> env = new HashMap<String, String>();
env.put("java.naming.factory.initial",
RMIContextFactory.class.getName());
for (int i = 0; i < retries; ++i) {
@@ -423,8 +491,8 @@ public class StorageInstaller {
log.debug("The storage node is not up.", e);
} else {
Throwable rootCause = ThrowableUtil.getRootCause(e);
- log.info("The storage node is not up: " +
rootCause.getClass().getName() + ": " +
- rootCause.getMessage());
+ log.info("The storage node is not up: " +
rootCause.getClass().getName() + ": "
+ + rootCause.getMessage());
}
log.info("Checking storage node status again in " +
(timeout * (i + 1)) + " ms...");
}
@@ -437,7 +505,7 @@ public class StorageInstaller {
public void printUsage() {
Options options = getOptions();
HelpFormatter helpFormatter = new HelpFormatter();
- String syntax = "rhq-storage-installer.sh [options]";
+ String syntax = "rhq-storage-installer.sh|bat [options]";
String header = "";
helpFormatter.printHelp(syntax, header, options, null);
diff --git a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.bat
index 4277d74..63cc162 100644
--- a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.bat
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.bat
@@ -23,16 +23,14 @@ rem RHQ_SERVER_JAVA_HOME - The location of the JRE that the Server
will
rem use. This will be ignored if
rem RHQ_SERVER_JAVA_EXE_FILE_PATH is set.
rem If this and RHQ_SERVER_JAVA_EXE_FILE_PATH are
-rem not set, the Server's embedded JRE will be used.
+rem not set, JAVA_HOME will be used.
rem
rem RHQ_SERVER_JAVA_EXE_FILE_PATH - Defines the full path to the Java
rem executable to use. If this is set,
rem RHQ_SERVER_JAVA_HOME is ignored.
rem If this is not set, then
rem %RHQ_SERVER_JAVA_HOME%\bin\java.exe
-rem is used. If this and
-rem RHQ_SERVER_JAVA_HOME are not set, the
-rem Server's embedded JRE will be used.
+rem is used.
rem
rem RHQ_SERVER_INSTANCE_NAME - The name of the Windows Service; it must
rem conform to the Windows Service naming
@@ -56,9 +54,6 @@ rem Note that you cannot define custom Java VM parameters or command
line
rem arguments to pass to the RHQ Server standalone.sh. If you wish to pass in
rem specific arguments, modify the rhq-server-wrapper.conf file.
rem
-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
rem This script does not use the built-in JBossAS run.bat.
rem ===========================================================================
@@ -89,17 +84,21 @@ set RHQ_SERVER_HOME=%CD%
if defined RHQ_SERVER_DEBUG echo RHQ_SERVER_HOME: %RHQ_SERVER_HOME%
rem ----------------------------------------------------------------------
-rem Find the Java executable and verify we have a VM available.
+rem Find the Java executable and verify we have a VM available
rem ----------------------------------------------------------------------
if not defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
- if not defined RHQ_SERVER_JAVA_HOME call :prepare_embedded_jre
+ if not defined RHQ_SERVER_JAVA_HOME (
+ if defined RHQ_STORAGE_DEBUG echo No JRE found - will try to use JAVA_HOME:
%JAVA_HOME%
+ set RHQ_SERVER_JAVA_HOME=%JAVA_HOME%
+ )
+)
+if not defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
+ set RHQ_SERVER_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_HOME%\bin\java.exe
)
-if not defined RHQ_SERVER_JAVA_EXE_FILE_PATH set
RHQ_SERVER_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_HOME%\bin\java.exe
-
-if defined RHQ_SERVER_DEBUG echo RHQ_SERVER_JAVA_HOME: %RHQ_SERVER_JAVA_HOME%
-if defined RHQ_SERVER_DEBUG echo RHQ_SERVER_JAVA_EXE_FILE_PATH:
%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+if defined RHQ_STORAGE_DEBUG echo RHQ_SERVER_JAVA_HOME: %RHQ_SERVER_JAVA_HOME%
+if defined RHQ_STORAGE_DEBUG echo RHQ_SERVER_JAVA_EXE_FILE_PATH:
%RHQ_SERVER_JAVA_EXE_FILE_PATH%
if not exist "%RHQ_SERVER_JAVA_EXE_FILE_PATH%" (
echo There is no JVM available.
@@ -112,7 +111,7 @@ rem Define the name used for the name of the Windows Service.
rem If this is not defined, the name of the computer is used.
rem ----------------------------------------------------------------------
-if "%RHQ_SERVER_INSTANCE_NAME%"=="" (
+if not defined RHQ_SERVER_INSTANCE_NAME (
set RHQ_SERVER_INSTANCE_NAME=rhqserver-%COMPUTERNAME%
)
if defined RHQ_SERVER_DEBUG echo RHQ_SERVER_INSTANCE_NAME: %RHQ_SERVER_INSTANCE_NAME%
@@ -149,12 +148,13 @@ rem
----------------------------------------------------------------------
rem Create and configure the wrapper log directory.
rem ----------------------------------------------------------------------
-if "%RHQ_SERVER_WRAPPER_LOG_DIR_PATH%" == "" (
- if not exist "%RHQ_SERVER_HOME%\logs" (
- mkdir "%RHQ_SERVER_HOME%\logs"
- )
+if not defined %RHQ_SERVER_WRAPPER_LOG_DIR_PATH (
set RHQ_SERVER_WRAPPER_LOG_DIR_PATH=%RHQ_SERVER_HOME%\logs
)
+if not exist "RHQ_SERVER_WRAPPER_LOG_DIR_PATH" (
+ mkdir "%RHQ_SERVER_WRAPPER_LOG_DIR_PATH%"
+)
+
if defined RHQ_SERVER_DEBUG echo RHQ_SERVER_WRAPPER_LOG_DIR_PATH:
%RHQ_SERVER_WRAPPER_LOG_DIR_PATH%
rem ----------------------------------------------------------------------
@@ -204,18 +204,6 @@ if /i "%1"=="status" (
echo Usage: %0 { install ^| start ^| stop ^| remove ^| status ^| console }
goto :done
-rem ----------------------------------------------------------------------
-rem CALL subroutine that prepares to use the embedded JRE
-rem ----------------------------------------------------------------------
-
-:prepare_embedded_jre
-set RHQ_SERVER_JAVA_HOME=%RHQ_SERVER_HOME%\jre
-if defined RHQ_SERVER_DEBUG echo Using the embedded JRE
-if not exist "%RHQ_SERVER_JAVA_HOME%" (
- if defined RHQ_SERVER_DEBUG echo No embedded JRE found - will try to use JAVA_HOME:
%JAVA_HOME%
- set RHQ_SERVER_JAVA_HOME=%JAVA_HOME%
-)
-goto :eof
rem ----------------------------------------------------------------------
rem CALL subroutine that exits this script normally
diff --git a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
index 42c8e45..38b45df 100755
--- a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-server.sh
@@ -36,16 +36,14 @@
# use. This will be ignored if
# RHQ_SERVER_JAVA_EXE_FILE_PATH is set.
# If this and RHQ_SERVER_JAVA_EXE_FILE_PATH are
-# not set, the Server's embedded JRE will be used.
+# not set, JAVA_HOME will be used.
#
# RHQ_SERVER_JAVA_EXE_FILE_PATH - Defines the full path to the Java
# executable to use. If this is set,
# RHQ_SERVER_JAVA_HOME is ignored.
# If this is not set, then
# $RHQ_SERVER_JAVA_HOME/bin/java
-# is used. If this and
-# RHQ_SERVER_JAVA_HOME are not set, the
-# Server's embedded JRE will be used.
+# is used.
#
# RHQ_SERVER_JAVA_OPTS - Java VM command line options to be
# passed into the Server's VM. If this is not defined
@@ -82,9 +80,6 @@
# If not defined, this defaults to the Server's
# bin directory.
#
-# If the embedded JRE is to be used but is not available, the fallback
-# JRE to be used will be determined by the JAVA_HOME environment variable.
-#
# This script calls standalone.sh when starting the underlying JBossAS server.
# =============================================================================
@@ -309,13 +304,8 @@ fi
if [ -z "$RHQ_SERVER_JAVA_EXE_FILE_PATH" ]; then
if [ -z "$RHQ_SERVER_JAVA_HOME" ]; then
- RHQ_SERVER_JAVA_HOME="${RHQ_SERVER_HOME}/jre"
- if [ -d "$RHQ_SERVER_JAVA_HOME" ]; then
- debug_msg "Using the embedded JRE"
- else
- debug_msg "No embedded JRE found - will try to use JAVA_HOME:
$JAVA_HOME"
- RHQ_SERVER_JAVA_HOME="$JAVA_HOME"
- fi
+ debug_msg "No JRE found - will try to use JAVA_HOME: $JAVA_HOME"
+ RHQ_SERVER_JAVA_HOME="$JAVA_HOME"
fi
debug_msg "RHQ_SERVER_JAVA_HOME: $RHQ_SERVER_JAVA_HOME"
RHQ_SERVER_JAVA_EXE_FILE_PATH="${RHQ_SERVER_JAVA_HOME}/bin/java"
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-storage-installer.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-storage-installer.bat
new file mode 100644
index 0000000..c9fd2ff
--- /dev/null
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-storage-installer.bat
@@ -0,0 +1,199 @@
+@echo off
+
+rem =============================================================================
+rem RHQ Storage Installer Script
+rem
+rem This file is used to complete the installation of the RHQ storage Server on a
+rem UNIX platform.
+rem
+rem This script is customizable by setting the following environment variables:
+rem
+rem RHQ_STORAGE_DEBUG - If this is defined, the script will emit debug
+rem messages. If this is not defined or set to "false"
+rem debug messages are not emitted.
+rem
+rem RHQ_SERVER_HOME - Defines where the server's home install directory is.
+rem If not defined, it will be assumed to be the parent
+rem directory of the directory where this script lives.
+rem
+rem RHQ_SERVER_JBOSS_HOME - The location of the AS instance that will
+rem host RHQ. If this is set, it overrides any
+rem JBOSS_HOME that might be set. If this not
+rem set, JBOSS_HOME is used as a fallback. If
+rem neither is set, it is assumed the AS bundled
+rem under RHQ_SERVER_HOME\jbossas is to be used.
+rem
+rem RHQ_SERVER_JAVA_HOME - The location of the JRE that the server will
+rem use. This will be ignored if
+rem RHQ_SERVER_JAVA_EXE_FILE_PATH is set.
+rem If this and RHQ_SERVER_JAVA_EXE_FILE_PATH are
+rem not set, JAVA_HOME will be used.
+rem
+rem RHQ_SERVER_JAVA_EXE_FILE_PATH - Defines the full path to the Java
+rem executable to use. If this is set,
+rem RHQ_SERVER_JAVA_HOME is ignored.
+rem If this is not set, then
+rem $RHQ_SERVER_JAVA_HOME\bin\java
+rem is used.
+rem
+rem RHQ_STORAGE_INSTALLER_JAVA_OPTS - Java VM command line options to be
+rem passed into the Java VM. If this is not defined
+rem this script will pass in a default set of options.
+rem If you only want to add options to the defaults,
+rem then you will want to use
+rem RHQ_STORAGE_ADDITIONAL_JAVA_OPTS instead.
+rem
+rem RHQ_STORAGE_INSTALLER_ADDITIONAL_JAVA_OPTS - additional Java VM command
+rem line options to be passed into the VM.
+rem This is added to RHQ_STORAGE_JAVA_OPTS; it
+rem is mainly used to augment the
+rem default set of options. This can be
+rem left unset if it is not needed.
+rem
+rem =============================================================================
+
+setlocal
+
+rem if debug variable is set, it is assumed to be on, unless its value is false
+if "%RHQ_STORAGE_DEBUG%" == "false" (
+ set RHQ_STORAGE_DEBUG=
+)
+
+rem ----------------------------------------------------------------------
+rem Change directory so the current directory is the Server home.
+rem ----------------------------------------------------------------------
+
+set RHQ_SERVER_BIN_DIR_PATH=%~dp0
+
+if not defined RHQ_SERVER_HOME (
+ cd "%RHQ_SERVER_BIN_DIR_PATH%\.."
+) else (
+ cd "%RHQ_SERVER_HOME%" || (
+ echo Cannot go to the RHQ_SERVER_HOME directory: %RHQ_SERVER_HOME%
+ exit /B 1
+ )
+)
+
+set RHQ_SERVER_HOME=%CD%
+
+if defined RHQ_STORAGE_DEBUG echo RHQ_SERVER_HOME: %RHQ_SERVER_HOME%
+
+rem ----------------------------------------------------------------------
+rem Determine what JBossAS instance to use.
+rem If RHQ_SERVER_JBOSS_HOME and JBOSS_HOME are both not defined, we will
+rem assume we are to run the embedded AS instance from the RHQ
+rem installation directory - RHQ_SERVER_HOME\jbossas
+rem ----------------------------------------------------------------------
+
+if not defined RHQ_SERVER_JBOSS_HOME (
+ if not defined JBOSS_HOME (
+ set RHQ_SERVER_JBOSS_HOME=%RHQ_SERVER_HOME%\jbossas
+ ) else (
+ if not exist "%JBOSS_HOME%" (
+ echo ERROR! JBOSS_HOME is not pointing to a valid AS directory
+ echo JBOSS_HOME: "%JBOSS_HOME%"
+ exit /B 1
+ )
+ set RHQ_SERVER_JBOSS_HOME=%JBOSS_HOME%
+ )
+) else (
+ cd %RHQ_SERVER_JBOSS_HOME% || (
+ echo ERROR! RHQ_SERVER_JBOSS_HOME is not pointing to a valid AS directory
+ echo RHQ_SERVER_JBOSS_HOME: "%RHQ_SERVER_JBOSS_HOME%"
+ exit /B 1
+ )
+)
+
+cd %RHQ_SERVER_JBOSS_HOME%
+set RHQ_SERVER_JBOSS_HOME=%CD%
+
+if defined RHQ_STORAGE_DEBUG echo RHQ_SERVER_JBOSS_HOME: %RHQ_SERVER_JBOSS_HOME%
+
+
+if not exist "%RHQ_SERVER_JBOSS_HOME%\jboss-modules.jar" (
+ echo ERROR! RHQ_SERVER_JBOSS_HOME is not pointing to a valid AS instance
+ echo Missing "%RHQ_SERVER_JBOSS_HOME%\jboss-modules.jar"
+ exit /B 1
+)
+
+rem we want the rest of this script to be able to assume cwd is the RHQ install dir
+cd "%RHQ_SERVER_HOME%"
+
+
+rem ----------------------------------------------------------------------
+rem Create the logs directory
+rem ----------------------------------------------------------------------
+
+set _LOG_DIR_PATH=%RHQ_SERVER_HOME%\logs
+if not exist "%_LOG_DIR_PATH%" (
+ mkdir "%_LOG_DIR_PATH%"
+)
+
+
+rem ----------------------------------------------------------------------
+rem Find the Java executable and verify we have a VM available
+rem ----------------------------------------------------------------------
+
+if not defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
+ if not defined RHQ_SERVER_JAVA_HOME (
+ if defined RHQ_STORAGE_DEBUG echo No JRE found - will try to use JAVA_HOME:
%JAVA_HOME%
+ set RHQ_SERVER_JAVA_HOME=%JAVA_HOME%
+ )
+)
+if not defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
+ set RHQ_SERVER_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_HOME%\bin\java.exe
+)
+
+if defined RHQ_STORAGE_DEBUG echo RHQ_SERVER_JAVA_HOME: %RHQ_SERVER_JAVA_HOME%
+if defined RHQ_STORAGE_DEBUG echo RHQ_SERVER_JAVA_EXE_FILE_PATH:
%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+
+if not exist "%RHQ_SERVER_JAVA_EXE_FILE_PATH%" (
+ echo There is no JVM available.
+ echo Please set RHQ_SERVER_JAVA_HOME or RHQ_SERVER_JAVA_EXE_FILE_PATH appropriately.
+ exit /B 1
+)
+
+
+rem ----------------------------------------------------------------------
+rem Prepare the VM command line options to be passed in
+rem ----------------------------------------------------------------------
+
+if not defined RHQ_STORAGE_INSTALLER_JAVA_OPTS (
+ set RHQ_STORAGE_INSTALLER_JAVA_OPTS=-Xms512M -Xmx512M -XX:PermSize=128M
-XX:MaxPermSize=128M -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true
+)
+
+rem Add the JVM opts that we always want to specify, whether or not the user set
RHQ_CCM_JAVA_OPTS.
+if defined RHQ_STORAGE_DEBUG (
+ set _RHQ_LOGLEVEL=DEBUG
+) else (
+ set _RHQ_LOGLEVEL=INFO
+)
+
+
+rem debugging the logging level now for development/testing
+set RHQ_STORAGE_INSTALLER_JAVA_OPTS=%RHQ_STORAGE_INSTALLER_JAVA_OPTS%
-Djava.awt.headless=true
-Drhq.server.properties-file=%RHQ_SERVER_HOME%\bin\rhq-server.properties
-Drhq.storage.installer.logdir=%RHQ_SERVER_HOME%\logs
-Drhq.storage.installer.loglevel=%_RHQ_LOGLEVEL% -Drhq.server.basedir=%RHQ_SERVER_HOME%
+
+rem Sample JPDA settings for remote socket debugging
+rem set RHQ_STORAGE_INSTALLER_JAVA_OPTS=%RHQ_STORAGE_INSTALLER_JAVA_OPTS%
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
+
+if defined RHQ_STORAGE_DEBUG echo "RHQ_STORAGE_INSTALLER_JAVA_OPTS:
%RHQ_STORAGE_INSTALLER_JAVA_OPTS%"
+if defined RHQ_STORAGE_DEBUG echo "RHQ_STORAGE_INSTALLER_ADDITIONAL_JAVA_OPTS:
%RHQ_STORAGE_INSTALLER_ADDITIONAL_JAVA_OPTS%"
+
+
+rem ----------------------------------------------------------------------
+rem We need to add our own modules to the core set of JBossAS modules.
+rem ----------------------------------------------------------------------
+set _RHQ_MODULES_PATH=%RHQ_SERVER_HOME%\modules
+set _INTERNAL_MODULES_PATH=%RHQ_SERVER_JBOSS_HOME%\modules
+set _JBOSS_MODULEPATH=%_RHQ_MODULES_PATH%;%_INTERNAL_MODULES_PATH%
+
+if defined RHQ_STORAGE_DEBUG echo _JBOSS_MODULEPATH: %_JBOSS_MODULEPATH%
+
+
+echo "Starting RHQ Storage Installer ..."
+
+rem start the AS instance with our main installer module
+"%RHQ_SERVER_JAVA_EXE_FILE_PATH%" %RHQ_STORAGE_INSTALLER_JAVA_OPTS%
%RHQ_STORAGE_INSTALLER_ADDITIONAL_JAVA_OPTS% -jar
"%RHQ_SERVER_JBOSS_HOME%\jboss-modules.jar" -mp "%_JBOSS_MODULEPATH%"
org.rhq.rhq-cassandra-installer %*
+
+:done
+endlocal
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-storage.bat
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-storage.bat
new file mode 100644
index 0000000..5058874
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhq-storage.bat
@@ -0,0 +1,232 @@
+@echo off
+
+rem ===========================================================================
+rem RHQ Storage Node (Cassandra) Windows Startup Script
+rem
+rem This file is used to install, start, stop and remove the RHQ Storage Node
+rem (cassandra) Windows Service for the Windows platform. The RHQ Storage node
+rem is actually wrapped by the Java Service Wrapper (JSW) and it is the JSW that
+rem is the actual executable that is registered as the Windows Service.
+rem
+rem This script is customizable by setting the following environment variables:
+rem
+
+rem RHQ_STORAGE_DEBUG - If this is defined, the script will emit debug
+rem messages. If unset or "false", debug is turned off.
+rem
+rem RHQ_SERVER_HOME - Defines where the Server's home install directory is.
+rem If not defined, it will be assumed to be the parent
+rem directory of the directory where this script lives.
+rem
+rem RHQ_STORAGE_HOME - Defines where the Storage Node's home install directory
+rem is. If not defined, it will be assumed to be
+rem %RHQ_SERVER_HOME%\rhq-storage.
+rem
+rem RHQ_SERVER_JAVA_HOME - The location of the JRE that the Server will
+rem use. This will be ignored if
+rem RHQ_SERVER_JAVA_EXE_FILE_PATH is set. If this and
+rem RHQ_SERVER_JAVA_EXE_FILE_PATH are not set, JAVA_HOME
+rem will be used.
+rem
+rem RHQ_SERVER_JAVA_EXE_FILE_PATH - Defines the full path to the Java
+rem executable to use. If this is set, RHQ_SERVER_JAVA_HOME
+rem is ignored. If this is not set, then
+rem %RHQ_SERVER_JAVA_HOME%\bin\java.exe is used.
+rem
+rem RHQ_STORAGE_INSTANCE_NAME - The name of the Windows Service; it must
+rem conform to the Windows Service naming conventions. By
+rem default, this is the name "rhqstorage-%COMPUTERNAME%"
+rem
+rem RHQ_STORAGE_WRAPPER_LOG_DIR_PATH - The full path to the location where
+rem the wrapper log file will go.
+rem
+rem RHQ_STORAGE_RUN_AS - if defined, then when the Windows Service is
+rem installed, the value is the domain\username of the
+rem user that the Windows Service will run as
+rem
+rem RHQ_STORAGE_RUN_AS_ME - if defined, then when the Windows Service is
+rem installed, the domain\username of the user that the Windows
+rem Service will run as will be the current user (.\%USERNAME%).
+rem This takes precedence over RHQ_STORAGE_RUN_AS.
+rem
+rem Note that you cannot define custom Java VM parameters or command line
+rem arguments to pass to Cassandra. If you wish to pass in specific arguments,
+rem modify the rhq-storage-wrapper.conf file.
+rem
+rem This script does not use the built-in cassandra.bat.
+rem ===========================================================================
+
+setlocal
+
+rem if debug variable is set, it is assumed to be on, unless its value is false
+if "%RHQ_STORAGE_DEBUG%" == "false" (
+ set RHQ_STORAGE_DEBUG=
+)
+
+rem ----------------------------------------------------------------------
+rem Change directory so the current directory is the Server home.
+rem ----------------------------------------------------------------------
+
+set RHQ_SERVER_BIN_DIR_PATH=%~dp0
+
+if not defined RHQ_SERVER_HOME (
+ cd "%RHQ_SERVER_BIN_DIR_PATH%\.."
+) else (
+ cd "%RHQ_SERVER_HOME%" || (
+ echo Cannot go to the RHQ_SERVER_HOME directory: %RHQ_SERVER_HOME%
+ exit /B 1
+ )
+)
+
+set RHQ_SERVER_HOME=%CD%
+
+if defined RHQ_STORAGE_DEBUG echo RHQ_SERVER_HOME: %RHQ_SERVER_HOME%
+
+rem ----------------------------------------------------------------------
+rem Change directory so the current directory is the Server home.
+rem ----------------------------------------------------------------------
+
+set RHQ_STORAGE_BIN_DIR_PATH=%~dp0
+
+if not defined RHQ_STORAGE_HOME (
+ set RHQ_STORAGE_HOME=%RHQ_SERVER_HOME%\rhq-storage
+)
+set RHQ_STORAGE_BIN_DIR_PATH=%RHQ_STORAGE_HOME%\bin
+
+if not exist %RHQ_STORAGE_BIN_DIR_PATH% (
+ echo Cannot find the RHQ_STORAGE bin directory: %RHQ_STORAGE_BIN_DIR_PATH%
+ exit /B 1
+)
+
+if defined RHQ_STORAGE_DEBUG echo RHQ_STORAGE_HOME: %RHQ_STORAGE_HOME%
+
+rem ----------------------------------------------------------------------
+rem Find the Java executable and verify we have a VM available
+
+rem ----------------------------------------------------------------------
+
+if not defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
+ if not defined RHQ_SERVER_JAVA_HOME (
+ if defined RHQ_STORAGE_DEBUG echo No JRE found - will try to use JAVA_HOME:
%JAVA_HOME%
+ set RHQ_SERVER_JAVA_HOME=%JAVA_HOME%
+ )
+)
+if not defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
+ set RHQ_SERVER_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_HOME%\bin\java.exe
+)
+
+if defined RHQ_STORAGE_DEBUG echo RHQ_SERVER_JAVA_HOME: %RHQ_SERVER_JAVA_HOME%
+if defined RHQ_STORAGE_DEBUG echo RHQ_SERVER_JAVA_EXE_FILE_PATH:
%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+
+if not exist "%RHQ_SERVER_JAVA_EXE_FILE_PATH%" (
+ echo There is no JVM available.
+ echo Please set RHQ_SERVER_JAVA_HOME or RHQ_SERVER_JAVA_EXE_FILE_PATH appropriately.
+ exit /B 1
+)
+
+
+rem ----------------------------------------------------------------------
+rem Define the name used for the name of the Windows Service.
+rem If this is not defined, the name of the computer is used.
+rem ----------------------------------------------------------------------
+
+if not defined RHQ_STORAGE_INSTANCE_NAME (
+ set RHQ_STORAGE_INSTANCE_NAME=rhqstorage-%COMPUTERNAME%
+)
+if defined RHQ_STORAGE_DEBUG echo RHQ_STORAGE_INSTANCE_NAME: %RHQ_STORAGE_INSTANCE_NAME%
+
+rem ----------------------------------------------------------------------
+rem Determine the wrapper directory.
+rem ----------------------------------------------------------------------
+
+set RHQ_STORAGE_WRAPPER_DIR_PATH=%RHQ_SERVER_BIN_DIR_PATH%\wrapper
+if defined RHQ_STORAGE_DEBUG echo RHQ_STORAGE_WRAPPER_DIR_PATH:
%RHQ_STORAGE_WRAPPER_DIR_PATH%
+
+rem ----------------------------------------------------------------------
+rem The Windows OS platform name is also the wrapper subdirectory name.
+rem ----------------------------------------------------------------------
+
+set RHQ_STORAGE_OS_PLATFORM=windows-x86_32
+if defined RHQ_STORAGE_DEBUG echo RHQ_STORAGE_OS_PLATFORM: %RHQ_STORAGE_OS_PLATFORM%
+
+rem ----------------------------------------------------------------------
+rem Determine the wrapper executable that this script will run.
+rem ----------------------------------------------------------------------
+
+set
RHQ_STORAGE_WRAPPER_EXE_FILE_PATH=%RHQ_STORAGE_WRAPPER_DIR_PATH%\%RHQ_STORAGE_OS_PLATFORM%\wrapper.exe
+if defined RHQ_STORAGE_DEBUG echo RHQ_STORAGE_WRAPPER_EXE_FILE_PATH:
%RHQ_STORAGE_WRAPPER_EXE_FILE_PATH%
+
+rem ----------------------------------------------------------------------
+rem Determine the Storage wrapper configuration file.
+rem ----------------------------------------------------------------------
+
+set
RHQ_STORAGE_WRAPPER_CONF_FILE_PATH=%RHQ_STORAGE_WRAPPER_DIR_PATH%\rhq-storage-wrapper.conf
+if defined RHQ_STORAGE_DEBUG echo RHQ_STORAGE_WRAPPER_CONF_FILE_PATH:
%RHQ_STORAGE_WRAPPER_CONF_FILE_PATH%
+
+rem ----------------------------------------------------------------------
+rem Create and configure the wrapper log directory.
+rem ----------------------------------------------------------------------
+
+if not defined RHQ_STORAGE_WRAPPER_LOG_DIR_PATH (
+ set RHQ_STORAGE_WRAPPER_LOG_DIR_PATH=%RHQ_SERVER_HOME%\logs
+)
+if not exist "%RHQ_STORAGE_WRAPPER_LOG_DIR_PATH%" (
+ mkdir "%RHQ_STORAGE_WRAPPER_LOG_DIR_PATH%"
+)
+
+if defined RHQ_STORAGE_DEBUG echo RHQ_STORAGE_WRAPPER_LOG_DIR_PATH:
%RHQ_STORAGE_WRAPPER_LOG_DIR_PATH%
+
+rem ----------------------------------------------------------------------
+rem Determine what to do and do it.
+rem ----------------------------------------------------------------------
+
+rem Determine if there should be debug VM options passed into it.
+rem For some reason, this can't go inside another if statement.
+if defined RHQ_STORAGE_DEBUG set _DEBUG_OPTS=wrapper.debug=true
+
+rem Determine what user the Windows Service will run as.
+if defined RHQ_STORAGE_RUN_AS set
_WRAPPER_NTSERVICE_ACCOUNT="wrapper.ntservice.account=%RHQ_STORAGE_RUN_AS%"
+if defined RHQ_STORAGE_RUN_AS_ME set
_WRAPPER_NTSERVICE_ACCOUNT="wrapper.ntservice.account=.\%USERNAME%"
+
+if /i "%1"=="console" (
+ rem START STORAGE NODE
+ start "%RHQ_STORAGE_WRAPPER_EXE_FILE_PATH%" -c
"%RHQ_STORAGE_WRAPPER_CONF_FILE_PATH%"
"set.RHQ_SERVER_HOME=%RHQ_SERVER_HOME%"
"set.RHQ_STORAGE_HOME=%RHQ_STORAGE_HOME%"
"set.RHQ_STORAGE_INSTANCE_NAME=%RHQ_STORAGE_INSTANCE_NAME%"
"set.RHQ_SERVER_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_EXE_FILE_PATH%"
"set.RHQ_STORAGE_OS_PLATFORM=%RHQ_STORAGE_OS_PLATFORM%"
"set.RHQ_STORAGE_WRAPPER_LOG_DIR_PATH=%RHQ_STORAGE_WRAPPER_LOG_DIR_PATH%"
%_WRAPPER_NTSERVICE_ACCOUNT% %_DEBUG_OPTS%
+ goto done
+)
+
+if /i "%1"=="install" (
+ "%RHQ_STORAGE_WRAPPER_EXE_FILE_PATH%" -i
"%RHQ_STORAGE_WRAPPER_CONF_FILE_PATH%"
"set.RHQ_SERVER_HOME=%RHQ_SERVER_HOME%"
"set.RHQ_STORAGE_HOME=%RHQ_STORAGE_HOME%"
"set.RHQ_STORAGE_INSTANCE_NAME=%RHQ_STORAGE_INSTANCE_NAME%"
"set.RHQ_SERVER_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_EXE_FILE_PATH%"
"set.RHQ_STORAGE_OS_PLATFORM=%RHQ_STORAGE_OS_PLATFORM%"
"set.RHQ_STORAGE_WRAPPER_LOG_DIR_PATH=%RHQ_STORAGE_WRAPPER_LOG_DIR_PATH%"
%_WRAPPER_NTSERVICE_ACCOUNT% %_DEBUG_OPTS%
+ goto done
+)
+
+if /i "%1"=="start" (
+ rem START STORAGE NODE
+ "%RHQ_STORAGE_WRAPPER_EXE_FILE_PATH%" -t
"%RHQ_STORAGE_WRAPPER_CONF_FILE_PATH%"
+ goto done
+)
+
+if /i "%1"=="stop" (
+ "%RHQ_STORAGE_WRAPPER_EXE_FILE_PATH%" -p
"%RHQ_STORAGE_WRAPPER_CONF_FILE_PATH%"
+ goto done
+)
+
+if /i "%1"=="remove" (
+ "%RHQ_STORAGE_WRAPPER_EXE_FILE_PATH%" -r
"%RHQ_STORAGE_WRAPPER_CONF_FILE_PATH%"
+ goto done
+)
+
+if /i "%1"=="status" (
+ "%RHQ_STORAGE_WRAPPER_EXE_FILE_PATH%" -q
"%RHQ_STORAGE_WRAPPER_CONF_FILE_PATH%"
+ goto done
+)
+
+echo Usage: %0 { install ^| start ^| stop ^| remove ^| status ^| console }
+goto :done
+
+
+rem ----------------------------------------------------------------------
+rem CALL subroutine that exits this script normally
+rem ----------------------------------------------------------------------
+
+:done
+endlocal
diff --git a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl
new file mode 100644
index 0000000..89ac456
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl
@@ -0,0 +1,241 @@
+#!/bin/sh
+
+# =============================================================================
+# RHQ Storage Installer Script
+#
+# This file is used to complete the installation of the RHQ storage Server on a
+# UNIX platform.
+#
+# This script is customizable by setting the following environment variables:
+#
+# RHQ_CONTROL_DEBUG - If this is defined, the script will emit debug
+# messages. If this is not defined or set to "false"
+# debug messages are not emitted.
+#
+# RHQ_SERVER_HOME - Defines where the server's home install directory is.
+# If not defined, it will be assumed to be the parent
+# directory of the directory where this script lives.
+#
+# RHQ_SERVER_JBOSS_HOME - The location of the AS instance that will
+# host RHQ. If this is set, it overrides any
+# JBOSS_HOME that might be set. If this not
+# set, JBOSS_HOME is used as a fallback. If
+# neither is set, it is assumed the AS bundled
+# under RHQ_SERVER_HOME/jbossas is to be used.
+#
+# RHQ_SERVER_JAVA_HOME - The location of the JRE that the server will
+# use. This will be ignored if
+# RHQ_SERVER_JAVA_EXE_FILE_PATH is set.
+# If this and RHQ_SERVER_JAVA_EXE_FILE_PATH are
+# not set, the Server's embedded JRE will be used.
+#
+# RHQ_SERVER_JAVA_EXE_FILE_PATH - Defines the full path to the Java
+# executable to use. If this is set,
+# RHQ_SERVER_JAVA_HOME is ignored.
+# If this is not set, then
+# $RHQ_SERVER_JAVA_HOME/bin/java
+# is used. If this and
+# RHQ_SERVER_JAVA_HOME are not set, the
+# Server's embedded JRE will be used.
+#
+# RHQ_CONTROL_JAVA_OPTS - Java VM command line options to be
+# passed into the Java VM. If this is not defined
+# this script will pass in a default set of options.
+# If you only want to add options to the defaults,
+# then you will want to use
+# RHQ_CONTROL_ADDITIONAL_JAVA_OPTS instead.
+#
+# RHQ_CONTROL_ADDITIONAL_JAVA_OPTS - additional Java VM command
+# line options to be passed into the VM.
+# This is added to RHQ_CONTROL_JAVA_OPTS; it
+# is mainly used to augment the
+# default set of options. This can be
+# left unset if it is not needed.
+#
+# If the embedded JRE is to be used but is not available, the fallback
+# JRE to be used will be determined by the JAVA_HOME environment variable.
+# =============================================================================
+
+debug_msg ()
+{
+ # if debug variable is set, it is assumed to be on, unless its value is false
+ if [ -n "$RHQ_CONTROL_DEBUG" ] && [ "$RHQ_CONTROL_DEBUG"
!= "false" ]; then
+ echo $1
+ fi
+}
+
+# ----------------------------------------------------------------------
+# Determine what specific platform we are running on.
+# Set some platform-specific variables.
+# ----------------------------------------------------------------------
+
+case "`uname`" in
+ CYGWIN*) _CYGWIN=true
+ ;;
+ Linux*) _LINUX=true
+ ;;
+ Darwin*) _DARWIN=true
+ ;;
+ SunOS*) _SOLARIS=true
+ ;;
+ AIX*) _AIX=true
+ ;;
+esac
+
+# only certain platforms support the -e argument for readlink
+if [ -n "${_LINUX}${_SOLARIS}${_CYGWIN}" ]; then
+ _READLINK_ARG="-e"
+fi
+
+# ----------------------------------------------------------------------
+# Determine the RHQ Server installation directory.
+# If RHQ_SERVER_HOME is not defined, we will assume we are running
+# directly from the server installation's bin directory.
+# ----------------------------------------------------------------------
+
+if [ -z "$RHQ_SERVER_HOME" ]; then
+ _DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo
"$0"`
+ RHQ_SERVER_HOME=`dirname "$_DOLLARZERO"`/..
+else
+ if [ ! -d "$RHQ_SERVER_HOME" ]; then
+ echo "ERROR! RHQ_SERVER_HOME is not pointing to a valid directory"
+ echo "RHQ_SERVER_HOME: $RHQ_SERVER_HOME"
+ exit 1
+ fi
+fi
+
+cd "$RHQ_SERVER_HOME"
+RHQ_SERVER_HOME=`pwd`
+
+debug_msg "RHQ_SERVER_HOME: $RHQ_SERVER_HOME"
+
+# ----------------------------------------------------------------------
+# Determine what JBossAS instance to use.
+# If RHQ_SERVER_JBOSS_HOME and JBOSS_HOME are both not defined, we will
+# assume we are to run the embedded AS instance from the RHQ
+# installation directory - RHQ_SERVER_HOME/jbossas
+# ----------------------------------------------------------------------
+
+if [ -z "$RHQ_SERVER_JBOSS_HOME" ]; then
+ if [ -z "$JBOSS_HOME" ]; then
+ RHQ_SERVER_JBOSS_HOME="${RHQ_SERVER_HOME}/jbossas"
+ else
+ if [ ! -d "$JBOSS_HOME" ]; then
+ echo "ERROR! JBOSS_HOME is not pointing to a valid AS directory"
+ echo "JBOSS_HOME: $JBOSS_HOME"
+ exit 1
+ fi
+ RHQ_SERVER_JBOSS_HOME="${JBOSS_HOME}"
+ fi
+else
+ if [ ! -d "$RHQ_SERVER_JBOSS_HOME" ]; then
+ echo "ERROR! RHQ_SERVER_JBOSS_HOME is not pointing to a valid AS
directory"
+ echo "RHQ_SERVER_JBOSS_HOME: $RHQ_SERVER_JBOSS_HOME"
+ exit 1
+ fi
+fi
+
+cd "$RHQ_SERVER_JBOSS_HOME"
+RHQ_SERVER_JBOSS_HOME=`pwd`
+
+debug_msg "RHQ_SERVER_JBOSS_HOME: $RHQ_SERVER_JBOSS_HOME"
+
+if [ ! -f "${RHQ_SERVER_JBOSS_HOME}/jboss-modules.jar" ]; then
+ echo "ERROR! RHQ_SERVER_JBOSS_HOME is not pointing to a valid AS instance"
+ echo "Missing ${RHQ_SERVER_JBOSS_HOME}/jboss-modules.jar"
+ exit 1
+fi
+
+# we want the rest of this script to be able to assume cwd is the RHQ install dir
+cd "$RHQ_SERVER_HOME"
+
+# ----------------------------------------------------------------------
+# if we are on a Mac and JAVA_HOME is not set, then set it to /usr
+# as this is the default location.
+# ----------------------------------------------------------------------
+
+if [ -z "$JAVA_HOME" ]; then
+ if [ -n "$_DARWIN" ]; then
+ debug_msg "Running on Mac OS X, setting JAVA_HOME to /usr"
+ JAVA_HOME=/usr
+ fi
+fi
+
+# ----------------------------------------------------------------------
+# Create the logs directory
+# ----------------------------------------------------------------------
+
+_LOG_DIR_PATH="${RHQ_SERVER_HOME}/logs"
+if [ -n "$_CYGWIN" ]; then
+ _LOG_DIR_PATH=`cygpath --windows --path "$_LOG_DIR_PATH"`
+fi
+if [ ! -d "${_LOG_DIR_PATH}" ]; then
+ mkdir "${_LOG_DIR_PATH}"
+fi
+
+# ----------------------------------------------------------------------
+# Find the Java executable and verify we have a VM available
+# ----------------------------------------------------------------------
+
+if [ -z "$RHQ_SERVER_JAVA_EXE_FILE_PATH" ]; then
+ if [ -z "$RHQ_SERVER_JAVA_HOME" ]; then
+ RHQ_SERVER_JAVA_HOME="${RHQ_SERVER_HOME}/jre"
+ if [ -d "$RHQ_SERVER_JAVA_HOME" ]; then
+ debug_msg "Using the embedded JRE"
+ else
+ debug_msg "No embedded JRE found - will try to use JAVA_HOME:
$JAVA_HOME"
+ RHQ_SERVER_JAVA_HOME="$JAVA_HOME"
+ fi
+ fi
+ debug_msg "RHQ_SERVER_JAVA_HOME: $RHQ_SERVER_JAVA_HOME"
+ RHQ_SERVER_JAVA_EXE_FILE_PATH="${RHQ_SERVER_JAVA_HOME}/bin/java"
+fi
+debug_msg "RHQ_SERVER_JAVA_EXE_FILE_PATH: $RHQ_SERVER_JAVA_EXE_FILE_PATH"
+
+if [ ! -f "$RHQ_SERVER_JAVA_EXE_FILE_PATH" ]; then
+ echo "There is no JVM available."
+ echo "Please set RHQ_SERVER_JAVA_HOME or RHQ_SERVER_JAVA_EXE_FILE_PATH
appropriately."
+ exit 1
+fi
+
+# ----------------------------------------------------------------------
+# Prepare the VM command line options to be passed in
+# ----------------------------------------------------------------------
+
+if [ -z "$RHQ_CONTROL_JAVA_OPTS" ]; then
+ RHQ_CONTROL_JAVA_OPTS="-Xms512M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=128M
-Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true"
+fi
+
+# Add the JVM opts that we always want to specify, whether or not the user set
RHQ_CCM_JAVA_OPTS.
+if [ -n "$RHQ_CONTROL_DEBUG" ] && [ "$RHQ_CONTROL_DEBUG" !=
"false" ]; then
+ _RHQ_LOGLEVEL="DEBUG"
+else
+ _RHQ_LOGLEVEL="INFO"
+fi
+
+# debugging the logging level now for development/testing
+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"
+
+# Sample JPDA settings for remote socket debugging
+#RHQ_CONTROL_JAVA_OPTS="${RHQ_CONTROL_JAVA_OPTS}
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
+
+debug_msg "RHQ_CONTROL_JAVA_OPTS: $RHQ_CONTROL_JAVA_OPTS"
+debug_msg "RHQ_CONTROL_ADDITIONAL_JAVA_OPTS:
$RHQ_CONTROL_ADDITIONAL_JAVA_OPTS"
+
+# ----------------------------------------------------------------------
+# We need to add our own modules to the core set of JBossAS modules.
+# ----------------------------------------------------------------------
+_RHQ_MODULES_PATH="${RHQ_SERVER_HOME}/modules"
+_INTERNAL_MODULES_PATH="${RHQ_SERVER_JBOSS_HOME}/modules"
+if [ -n "$_CYGWIN" ]; then
+ _RHQ_MODULES_PATH=`cygpath --windows --path "$_RHQ_MODULES_PATH"`
+ _INTERNAL_MODULES_PATH=`cygpath --windows --path "$_INTERNAL_MODULES_PATH"`
+fi
+_JBOSS_MODULEPATH="${_RHQ_MODULES_PATH}:${_INTERNAL_MODULES_PATH}"
+debug_msg "_JBOSS_MODULEPATH: $_JBOSS_MODULEPATH"
+
+# start the AS instance with our main installer module
+"$RHQ_SERVER_JAVA_EXE_FILE_PATH" ${RHQ_CONTROL_JAVA_OPTS}
${RHQ_CONTROL_ADDITIONAL_JAVA_OPTS} -jar
"${RHQ_SERVER_JBOSS_HOME}/jboss-modules.jar" -mp "$_JBOSS_MODULEPATH"
org.rhq.rhq-server-control "$@"
+
+_EXIT_STATUS=$?
+exit $_EXIT_STATUS
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
new file mode 100644
index 0000000..2047e5b
--- /dev/null
+++ b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.bat
@@ -0,0 +1,193 @@
+@echo off
+
+rem =============================================================================
+rem RHQ Storage Installer Script
+
+rem This file is used to control the RHQ components on a Windows machine.
+
+rem This script is customizable by setting the following environment variables:
+
+rem RHQ_CONTROL_DEBUG - If this is defined, the script will emit debug
+rem messages. If this is not defined or set to "false"
+rem debug messages are not emitted.
+
+rem RHQ_SERVER_HOME - Defines where the server's home install directory is.
+rem If not defined, it will be assumed to be the parent
+rem directory of the directory where this script lives.
+
+rem RHQ_SERVER_JBOSS_HOME - The location of the AS instance that will
+rem host RHQ. If this is set, it overrides any
+rem JBOSS_HOME that might be set. If this not
+rem set, JBOSS_HOME is used as a fallback. If
+rem neither is set, it is assumed the AS bundled
+rem under RHQ_SERVER_HOME\jbossas is to be used.
+
+rem RHQ_SERVER_JAVA_HOME - The location of the JRE that the server will
+rem use. This will be ignored if
+rem RHQ_SERVER_JAVA_EXE_FILE_PATH is set.
+rem If this and RHQ_SERVER_JAVA_EXE_FILE_PATH are
+rem not set, JAVA_HOME will be used.
+
+rem RHQ_SERVER_JAVA_EXE_FILE_PATH - Defines the full path to the Java
+rem executable to use. If this is set,
+rem RHQ_SERVER_JAVA_HOME is ignored.
+rem If this is not set, then
+rem $RHQ_SERVER_JAVA_HOME\bin\java
+rem is used.
+
+rem RHQ_CONTROL_JAVA_OPTS - Java VM command line options to be
+rem passed into the Java VM. If this is not defined
+rem this script will pass in a default set of options.
+rem If you only want to add options to the defaults,
+rem then you will want to use
+rem RHQ_CONTROL_ADDITIONAL_JAVA_OPTS instead.
+
+rem RHQ_CONTROL_ADDITIONAL_JAVA_OPTS - additional Java VM command
+rem line options to be passed into the VM.
+rem This is added to RHQ_CONTROL_JAVA_OPTS; it
+rem is mainly used to augment the
+rem default set of options. This can be
+rem left unset if it is not needed.
+
+rem =============================================================================
+
+setlocal
+
+rem if debug variable is set, it is assumed to be on, unless its value is false
+if "%RHQ_CONTROL_DEBUG%" == "false" (
+ set RHQ_CONTROL_DEBUG=
+)
+
+rem ----------------------------------------------------------------------
+rem Change directory so the current directory is the Server home.
+rem ----------------------------------------------------------------------
+
+set RHQ_SERVER_BIN_DIR_PATH=%~dp0
+
+if not defined RHQ_SERVER_HOME (
+ cd "%RHQ_SERVER_BIN_DIR_PATH%\.."
+) else (
+ cd "%RHQ_SERVER_HOME%" || (
+ echo Cannot go to the RHQ_SERVER_HOME directory: %RHQ_SERVER_HOME%
+ exit /B 1
+ )
+)
+
+set RHQ_SERVER_HOME=%CD%
+
+if defined RHQ_CONTROL_DEBUG echo RHQ_SERVER_HOME: %RHQ_SERVER_HOME%
+
+rem ----------------------------------------------------------------------
+rem Determine what JBossAS instance to use.
+rem If RHQ_SERVER_JBOSS_HOME and JBOSS_HOME are both not defined, we will
+rem assume we are to run the embedded AS instance from the RHQ
+rem installation directory - RHQ_SERVER_HOME\jbossas
+rem ----------------------------------------------------------------------
+
+if not defined RHQ_SERVER_JBOSS_HOME (
+ if not defined JBOSS_HOME (
+ set RHQ_SERVER_JBOSS_HOME=%RHQ_SERVER_HOME%\jbossas
+ ) else (
+ if not exist "%JBOSS_HOME%" (
+ echo ERROR! JBOSS_HOME is not pointing to a valid AS directory
+ echo JBOSS_HOME: "%JBOSS_HOME%"
+ exit /B 1
+ )
+ set RHQ_SERVER_JBOSS_HOME=%JBOSS_HOME%
+ )
+) else (
+ cd %RHQ_SERVER_JBOSS_HOME% || (
+ echo ERROR! RHQ_SERVER_JBOSS_HOME is not pointing to a valid AS directory
+ echo RHQ_SERVER_JBOSS_HOME: "%RHQ_SERVER_JBOSS_HOME%"
+ exit /B 1
+ )
+)
+
+cd %RHQ_SERVER_JBOSS_HOME%
+set RHQ_SERVER_JBOSS_HOME=%CD%
+
+if defined RHQ_CONTROL_DEBUG echo RHQ_SERVER_JBOSS_HOME: %RHQ_SERVER_JBOSS_HOME%
+
+
+if not exist "%RHQ_SERVER_JBOSS_HOME%\jboss-modules.jar" (
+ echo ERROR! RHQ_SERVER_JBOSS_HOME is not pointing to a valid AS instance
+ echo Missing "%RHQ_SERVER_JBOSS_HOME%\jboss-modules.jar"
+ exit /B 1
+)
+
+rem we want the rest of this script to be able to assume cwd is the RHQ install dir
+cd "%RHQ_SERVER_HOME%"
+
+
+rem ----------------------------------------------------------------------
+rem Create the logs directory
+rem ----------------------------------------------------------------------
+
+set _LOG_DIR_PATH=%RHQ_SERVER_HOME%\logs
+if not exist "%_LOG_DIR_PATH%" (
+ mkdir "%_LOG_DIR_PATH%"
+)
+
+
+rem ----------------------------------------------------------------------
+rem Find the Java executable and verify we have a VM available
+rem ----------------------------------------------------------------------
+
+if not defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
+ if not defined RHQ_SERVER_JAVA_HOME (
+ if defined RHQ_CONTROL_DEBUG echo No JRE found - will try to use JAVA_HOME:
%JAVA_HOME%
+ set RHQ_SERVER_JAVA_HOME=%JAVA_HOME%
+ )
+)
+if not defined RHQ_SERVER_JAVA_EXE_FILE_PATH (
+ set RHQ_SERVER_JAVA_EXE_FILE_PATH=%RHQ_SERVER_JAVA_HOME%\bin\java.exe
+)
+
+if defined RHQ_CONTROL_DEBUG echo RHQ_SERVER_JAVA_HOME: %RHQ_SERVER_JAVA_HOME%
+if defined RHQ_CONTROL_DEBUG echo RHQ_SERVER_JAVA_EXE_FILE_PATH:
%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+
+if not exist "%RHQ_SERVER_JAVA_EXE_FILE_PATH%" (
+ echo There is no JVM available.
+ echo Please set RHQ_SERVER_JAVA_HOME or RHQ_SERVER_JAVA_EXE_FILE_PATH appropriately.
+ exit /B 1
+)
+
+
+rem ----------------------------------------------------------------------
+rem Prepare the VM command line options to be passed in
+rem ----------------------------------------------------------------------
+
+if not defined RHQ_CONTROL_JAVA_OPTS (
+ set RHQ_CONTROL_JAVA_OPTS=-Xms512M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=128M
-Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true
+)
+
+rem Add the JVM opts that we always want to specify, whether or not the user set
RHQ_CCM_JAVA_OPTS.
+if defined RHQ_CONTROL_DEBUG (
+ set _RHQ_LOGLEVEL=DEBUG
+) else (
+ set _RHQ_LOGLEVEL=INFO
+)
+
+rem debugging the logging level now for development/testing
+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
+
+rem Sample JPDA settings for remote socket debugging
+rem set RHQ_CONTROL_JAVA_OPTS=%RHQ_CONTROL_JAVA_OPTS%
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y
+
+if defined RHQ_CONTROL_DEBUG echo RHQ_CONTROL_JAVA_OPTS: %RHQ_CONTROL_JAVA_OPTS%
+if defined RHQ_CONTROL_DEBUG echo RHQ_CONTROL_ADDITIONAL_JAVA_OPTS:
%RHQ_CONTROL_ADDITIONAL_JAVA_OPTS%
+
+rem ----------------------------------------------------------------------
+rem We need to add our own modules to the core set of JBossAS modules.
+rem ----------------------------------------------------------------------
+set _RHQ_MODULES_PATH=%RHQ_SERVER_HOME%\modules
+set _INTERNAL_MODULES_PATH=%RHQ_SERVER_JBOSS_HOME%\modules
+set _JBOSS_MODULEPATH=%_RHQ_MODULES_PATH%;%_INTERNAL_MODULES_PATH%
+
+if defined RHQ_CONTROL_DEBUG echo _JBOSS_MODULEPATH: %_JBOSS_MODULEPATH%
+
+rem start the AS instance with our main installer module
+"%RHQ_SERVER_JAVA_EXE_FILE_PATH%" %RHQ_CONTROL_JAVA_OPTS%
%RHQ_CONTROL_ADDITIONAL_JAVA_OPTS% -jar
"%RHQ_SERVER_JBOSS_HOME%\jboss-modules.jar" -mp "%_JBOSS_MODULEPATH%"
org.rhq.rhq-server-control %*
+
+:done
+endlocal
diff --git a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.sh
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.sh
deleted file mode 100755
index 89ac456..0000000
--- a/modules/enterprise/server/appserver/src/main/bin-resources/bin/rhqctl.sh
+++ /dev/null
@@ -1,241 +0,0 @@
-#!/bin/sh
-
-# =============================================================================
-# RHQ Storage Installer Script
-#
-# This file is used to complete the installation of the RHQ storage Server on a
-# UNIX platform.
-#
-# This script is customizable by setting the following environment variables:
-#
-# RHQ_CONTROL_DEBUG - If this is defined, the script will emit debug
-# messages. If this is not defined or set to "false"
-# debug messages are not emitted.
-#
-# RHQ_SERVER_HOME - Defines where the server's home install directory is.
-# If not defined, it will be assumed to be the parent
-# directory of the directory where this script lives.
-#
-# RHQ_SERVER_JBOSS_HOME - The location of the AS instance that will
-# host RHQ. If this is set, it overrides any
-# JBOSS_HOME that might be set. If this not
-# set, JBOSS_HOME is used as a fallback. If
-# neither is set, it is assumed the AS bundled
-# under RHQ_SERVER_HOME/jbossas is to be used.
-#
-# RHQ_SERVER_JAVA_HOME - The location of the JRE that the server will
-# use. This will be ignored if
-# RHQ_SERVER_JAVA_EXE_FILE_PATH is set.
-# If this and RHQ_SERVER_JAVA_EXE_FILE_PATH are
-# not set, the Server's embedded JRE will be used.
-#
-# RHQ_SERVER_JAVA_EXE_FILE_PATH - Defines the full path to the Java
-# executable to use. If this is set,
-# RHQ_SERVER_JAVA_HOME is ignored.
-# If this is not set, then
-# $RHQ_SERVER_JAVA_HOME/bin/java
-# is used. If this and
-# RHQ_SERVER_JAVA_HOME are not set, the
-# Server's embedded JRE will be used.
-#
-# RHQ_CONTROL_JAVA_OPTS - Java VM command line options to be
-# passed into the Java VM. If this is not defined
-# this script will pass in a default set of options.
-# If you only want to add options to the defaults,
-# then you will want to use
-# RHQ_CONTROL_ADDITIONAL_JAVA_OPTS instead.
-#
-# RHQ_CONTROL_ADDITIONAL_JAVA_OPTS - additional Java VM command
-# line options to be passed into the VM.
-# This is added to RHQ_CONTROL_JAVA_OPTS; it
-# is mainly used to augment the
-# default set of options. This can be
-# left unset if it is not needed.
-#
-# If the embedded JRE is to be used but is not available, the fallback
-# JRE to be used will be determined by the JAVA_HOME environment variable.
-# =============================================================================
-
-debug_msg ()
-{
- # if debug variable is set, it is assumed to be on, unless its value is false
- if [ -n "$RHQ_CONTROL_DEBUG" ] && [ "$RHQ_CONTROL_DEBUG"
!= "false" ]; then
- echo $1
- fi
-}
-
-# ----------------------------------------------------------------------
-# Determine what specific platform we are running on.
-# Set some platform-specific variables.
-# ----------------------------------------------------------------------
-
-case "`uname`" in
- CYGWIN*) _CYGWIN=true
- ;;
- Linux*) _LINUX=true
- ;;
- Darwin*) _DARWIN=true
- ;;
- SunOS*) _SOLARIS=true
- ;;
- AIX*) _AIX=true
- ;;
-esac
-
-# only certain platforms support the -e argument for readlink
-if [ -n "${_LINUX}${_SOLARIS}${_CYGWIN}" ]; then
- _READLINK_ARG="-e"
-fi
-
-# ----------------------------------------------------------------------
-# Determine the RHQ Server installation directory.
-# If RHQ_SERVER_HOME is not defined, we will assume we are running
-# directly from the server installation's bin directory.
-# ----------------------------------------------------------------------
-
-if [ -z "$RHQ_SERVER_HOME" ]; then
- _DOLLARZERO=`readlink $_READLINK_ARG "$0" 2>/dev/null || echo
"$0"`
- RHQ_SERVER_HOME=`dirname "$_DOLLARZERO"`/..
-else
- if [ ! -d "$RHQ_SERVER_HOME" ]; then
- echo "ERROR! RHQ_SERVER_HOME is not pointing to a valid directory"
- echo "RHQ_SERVER_HOME: $RHQ_SERVER_HOME"
- exit 1
- fi
-fi
-
-cd "$RHQ_SERVER_HOME"
-RHQ_SERVER_HOME=`pwd`
-
-debug_msg "RHQ_SERVER_HOME: $RHQ_SERVER_HOME"
-
-# ----------------------------------------------------------------------
-# Determine what JBossAS instance to use.
-# If RHQ_SERVER_JBOSS_HOME and JBOSS_HOME are both not defined, we will
-# assume we are to run the embedded AS instance from the RHQ
-# installation directory - RHQ_SERVER_HOME/jbossas
-# ----------------------------------------------------------------------
-
-if [ -z "$RHQ_SERVER_JBOSS_HOME" ]; then
- if [ -z "$JBOSS_HOME" ]; then
- RHQ_SERVER_JBOSS_HOME="${RHQ_SERVER_HOME}/jbossas"
- else
- if [ ! -d "$JBOSS_HOME" ]; then
- echo "ERROR! JBOSS_HOME is not pointing to a valid AS directory"
- echo "JBOSS_HOME: $JBOSS_HOME"
- exit 1
- fi
- RHQ_SERVER_JBOSS_HOME="${JBOSS_HOME}"
- fi
-else
- if [ ! -d "$RHQ_SERVER_JBOSS_HOME" ]; then
- echo "ERROR! RHQ_SERVER_JBOSS_HOME is not pointing to a valid AS
directory"
- echo "RHQ_SERVER_JBOSS_HOME: $RHQ_SERVER_JBOSS_HOME"
- exit 1
- fi
-fi
-
-cd "$RHQ_SERVER_JBOSS_HOME"
-RHQ_SERVER_JBOSS_HOME=`pwd`
-
-debug_msg "RHQ_SERVER_JBOSS_HOME: $RHQ_SERVER_JBOSS_HOME"
-
-if [ ! -f "${RHQ_SERVER_JBOSS_HOME}/jboss-modules.jar" ]; then
- echo "ERROR! RHQ_SERVER_JBOSS_HOME is not pointing to a valid AS instance"
- echo "Missing ${RHQ_SERVER_JBOSS_HOME}/jboss-modules.jar"
- exit 1
-fi
-
-# we want the rest of this script to be able to assume cwd is the RHQ install dir
-cd "$RHQ_SERVER_HOME"
-
-# ----------------------------------------------------------------------
-# if we are on a Mac and JAVA_HOME is not set, then set it to /usr
-# as this is the default location.
-# ----------------------------------------------------------------------
-
-if [ -z "$JAVA_HOME" ]; then
- if [ -n "$_DARWIN" ]; then
- debug_msg "Running on Mac OS X, setting JAVA_HOME to /usr"
- JAVA_HOME=/usr
- fi
-fi
-
-# ----------------------------------------------------------------------
-# Create the logs directory
-# ----------------------------------------------------------------------
-
-_LOG_DIR_PATH="${RHQ_SERVER_HOME}/logs"
-if [ -n "$_CYGWIN" ]; then
- _LOG_DIR_PATH=`cygpath --windows --path "$_LOG_DIR_PATH"`
-fi
-if [ ! -d "${_LOG_DIR_PATH}" ]; then
- mkdir "${_LOG_DIR_PATH}"
-fi
-
-# ----------------------------------------------------------------------
-# Find the Java executable and verify we have a VM available
-# ----------------------------------------------------------------------
-
-if [ -z "$RHQ_SERVER_JAVA_EXE_FILE_PATH" ]; then
- if [ -z "$RHQ_SERVER_JAVA_HOME" ]; then
- RHQ_SERVER_JAVA_HOME="${RHQ_SERVER_HOME}/jre"
- if [ -d "$RHQ_SERVER_JAVA_HOME" ]; then
- debug_msg "Using the embedded JRE"
- else
- debug_msg "No embedded JRE found - will try to use JAVA_HOME:
$JAVA_HOME"
- RHQ_SERVER_JAVA_HOME="$JAVA_HOME"
- fi
- fi
- debug_msg "RHQ_SERVER_JAVA_HOME: $RHQ_SERVER_JAVA_HOME"
- RHQ_SERVER_JAVA_EXE_FILE_PATH="${RHQ_SERVER_JAVA_HOME}/bin/java"
-fi
-debug_msg "RHQ_SERVER_JAVA_EXE_FILE_PATH: $RHQ_SERVER_JAVA_EXE_FILE_PATH"
-
-if [ ! -f "$RHQ_SERVER_JAVA_EXE_FILE_PATH" ]; then
- echo "There is no JVM available."
- echo "Please set RHQ_SERVER_JAVA_HOME or RHQ_SERVER_JAVA_EXE_FILE_PATH
appropriately."
- exit 1
-fi
-
-# ----------------------------------------------------------------------
-# Prepare the VM command line options to be passed in
-# ----------------------------------------------------------------------
-
-if [ -z "$RHQ_CONTROL_JAVA_OPTS" ]; then
- RHQ_CONTROL_JAVA_OPTS="-Xms512M -Xmx512M -XX:PermSize=128M -XX:MaxPermSize=128M
-Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true"
-fi
-
-# Add the JVM opts that we always want to specify, whether or not the user set
RHQ_CCM_JAVA_OPTS.
-if [ -n "$RHQ_CONTROL_DEBUG" ] && [ "$RHQ_CONTROL_DEBUG" !=
"false" ]; then
- _RHQ_LOGLEVEL="DEBUG"
-else
- _RHQ_LOGLEVEL="INFO"
-fi
-
-# debugging the logging level now for development/testing
-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"
-
-# Sample JPDA settings for remote socket debugging
-#RHQ_CONTROL_JAVA_OPTS="${RHQ_CONTROL_JAVA_OPTS}
-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
-
-debug_msg "RHQ_CONTROL_JAVA_OPTS: $RHQ_CONTROL_JAVA_OPTS"
-debug_msg "RHQ_CONTROL_ADDITIONAL_JAVA_OPTS:
$RHQ_CONTROL_ADDITIONAL_JAVA_OPTS"
-
-# ----------------------------------------------------------------------
-# We need to add our own modules to the core set of JBossAS modules.
-# ----------------------------------------------------------------------
-_RHQ_MODULES_PATH="${RHQ_SERVER_HOME}/modules"
-_INTERNAL_MODULES_PATH="${RHQ_SERVER_JBOSS_HOME}/modules"
-if [ -n "$_CYGWIN" ]; then
- _RHQ_MODULES_PATH=`cygpath --windows --path "$_RHQ_MODULES_PATH"`
- _INTERNAL_MODULES_PATH=`cygpath --windows --path "$_INTERNAL_MODULES_PATH"`
-fi
-_JBOSS_MODULEPATH="${_RHQ_MODULES_PATH}:${_INTERNAL_MODULES_PATH}"
-debug_msg "_JBOSS_MODULEPATH: $_JBOSS_MODULEPATH"
-
-# start the AS instance with our main installer module
-"$RHQ_SERVER_JAVA_EXE_FILE_PATH" ${RHQ_CONTROL_JAVA_OPTS}
${RHQ_CONTROL_ADDITIONAL_JAVA_OPTS} -jar
"${RHQ_SERVER_JBOSS_HOME}/jboss-modules.jar" -mp "$_JBOSS_MODULEPATH"
org.rhq.rhq-server-control "$@"
-
-_EXIT_STATUS=$?
-exit $_EXIT_STATUS
diff --git
a/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.conf
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.conf
new file mode 100644
index 0000000..306df82
--- /dev/null
+++
b/modules/enterprise/server/appserver/src/main/bin-resources/bin/wrapper/rhq-storage-wrapper.conf
@@ -0,0 +1,202 @@
+#*****************************************************************************
+# RHQ Storage Node Java Service Wrapper Configuration File
+#
+# If you wish to modify these settings or add additional ones, it is
+# recommended that you do not modify this file; instead, create your own
+# override include file named "rhq-storage-wrapper.inc" and place it in the
+# same directory where this file is located.
+#
+# See
http://wrapper.tanukisoftware.org/doc/english/properties.html
+# for full documentation on all available wrapper.* settings
+#*****************************************************************************
+
+#*****************************************************************************
+# Environment Variables Required
+#
+# All of the below environment variables may be either specified in the
+# process environment or in the wrapper environment configuration file or on
+# the command line. The wrapper environment configuration file must be
+# named "rhq-storage-wrapper.env" and must be placed in the same directory
+# where this file is located.
+#
+# Note that all paths must be full, absolute paths unless noted otherwise.
+#
+# set.RHQ_SERVER_HOME - RHQ Server installation directory
+# set.RHQ_STORAGE_HOME - RHQ Storage Node installation directory
+# set.RHQ_STORAGE_INSTANCE_NAME - A name to identify the RHQ Storage Node
+# set.RHQ_SERVER_JAVA_EXE_FILE_PATH - Java executable
+# set.RHQ_STORAGE_OS_PLATFORM - The operating system platform name
+# set.RHQ_STORAGE_WRAPPER_LOG_DIR_PATH - The Java Service Wrapper's log file (helpful
if installing, uninstalling or starting fails)
+#*****************************************************************************
+
+# Load in the specific environment for the RHQ Storage Node instance to start
+#include %RHQ_SERVER_HOME%/bin/wrapper/rhq-storage-wrapper.env
+
+#*****************************************************************************
+# Start Properties
+#*****************************************************************************
+# Java JVM Executable (quotes not needed)
+wrapper.java.command=%RHQ_SERVER_JAVA_EXE_FILE_PATH%
+
+# Java Main class. This class must implement the WrapperListener interface. (quotes not
needed)
+wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
+
+# Java Classpath (include wrapper.jar). Add classpath elements starting at 1 (quotes not
needed)
+wrapper.java.classpath.1=%RHQ_SERVER_HOME%\bin\wrapper\%RHQ_STORAGE_OS_PLATFORM%\wrapper.jar
+wrapper.java.classpath.2=%RHQ_STORAGE_HOME%\conf
+wrapper.java.classpath.3=%RHQ_STORAGE_HOME%\lib\*.jar
+
+
+# Java Library Path (location of wrapper.dll/libwrapper.so and other JNI libs) (quotes
not needed)
+wrapper.java.library.path.1=%RHQ_SERVER_HOME%\bin\wrapper\%RHQ_STORAGE_OS_PLATFORM%
+
+# The RHQ Storage Node starts Cassandra
+wrapper.app.parameter.1=org.apache.cassandra.service.CassandraDaemon
+
+# Additional command line arguments to be passed to Cassandra (quotes ARE needed)
+wrapper.app.parameter.2="-Dcassandra"
+wrapper.app.parameter.3="-Dcassandra-foreground=yes"
+
+# Additional JVM parameters (quotes ARE needed)
+wrapper.java.additional.1="-ea"
+wrapper.java.additional.2="-javaagent:"%RHQ_STORAGE_HOME%\lib\jamm-0.2.5.jar""
+wrapper.java.additional.3="-Xms1G"
+wrapper.java.additional.4="-Xmx1G"
+wrapper.java.additional.5="-XX:+HeapDumpOnOutOfMemoryError"
+wrapper.java.additional.6="-XX:+UseParNewGC"
+wrapper.java.additional.7="-XX:+UseConcMarkSweepGC"
+wrapper.java.additional.8="-XX:+CMSParallelRemarkEnabled"
+wrapper.java.additional.9="-XX:SurvivorRatio=8"
+wrapper.java.additional.10="-XX:MaxTenuringThreshold=1"
+wrapper.java.additional.11="-XX:CMSInitiatingOccupancyFraction=75"
+wrapper.java.additional.12="-XX:+UseCMSInitiatingOccupancyOnly"
+wrapper.java.additional.13="-Dcom.sun.management.jmxremote.port=7299"
+wrapper.java.additional.14="-Dcom.sun.management.jmxremote.ssl=false"
+wrapper.java.additional.15="-Dcom.sun.management.jmxremote.authenticate=false"
+wrapper.java.additional.16="-Dlog4j.configuration=log4j-server.properties"
+wrapper.java.additional.17="-Dlog4j.defaultInitOverride=true"
+
+# We want to make sure the Storage Node starts in the casandra bin directory
+wrapper.working.dir=%RHQ_STORAGE_HOME%/bin
+
+#*****************************************************************************
+# Wrapper Logging Properties
+#*****************************************************************************
+# if TRUE, this will turn logging level immediately to DEBUG
+wrapper.debug=FALSE
+
+# Format of output for the console. (See docs for formats)
+wrapper.console.format=M
+
+# Log Level for console output. (NONE,DEBUG,STATUS,INFO,ERROR,FATAL)
+wrapper.console.loglevel=INFO
+
+# Log file to use for wrapper output logging. (quotes not needed)
+wrapper.logfile=%RHQ_STORAGE_WRAPPER_LOG_DIR_PATH%/rhq-storage-wrapper.log
+
+# Format of output for the log file. (See docs for formats)
+wrapper.logfile.format=LPTM
+
+# Log Level for log file output. (NONE,DEBUG,STATUS,INFO,ERROR,FATAL)
+wrapper.logfile.loglevel=ERROR
+
+# Maximum size that the log file will be allowed to grow to before
+# the log is rolled. Size is specified in bytes. The default value
+# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
+# 'm' (mb) suffix. For example: 10m = 10 megabytes.
+wrapper.logfile.maxsize=1m
+
+# Maximum number of rolled log files which will be allowed before old
+# files are deleted. The default value of 0 implies no limit.
+wrapper.logfile.maxfiles=1
+
+# Log Level for sys/event log output. (See docs for log levels)
+wrapper.syslog.loglevel=NONE
+
+# if JVM hangs, this tries to get a thread dump
+# (if TRUE, then ntservice.console is forced to TRUE as well)
+wrapper.request_thread_dump_on_failed_jvm_exit=FALSE
+
+#*****************************************************************************
+# Wrapper Windows Properties
+#*****************************************************************************
+# Title to use when running as a console
+wrapper.console.title=RHQ Storage [%RHQ_STORAGE_INSTANCE_NAME%]
+
+#*****************************************************************************
+# Wrapper Windows XP Service Properties
+#*****************************************************************************
+# WARNING - Do not modify any of these properties when an application
+# using this configuration file has been installed as a service.
+# Please uninstall the service before modifying this section. The
+# service can then be reinstalled.
+
+# Name of the service
+wrapper.ntservice.name=%RHQ_STORAGE_INSTANCE_NAME%
+
+# Display name of the service
+wrapper.ntservice.displayname=RHQ Storage [%RHQ_STORAGE_INSTANCE_NAME%]
+
+# Description of the service
+wrapper.ntservice.description=RHQ Storage Node instance named
%RHQ_STORAGE_INSTANCE_NAME%
+
+# Service dependencies. Add dependencies as needed starting from 1
+wrapper.ntservice.dependency.1=
+
+# Mode in which the service is installed. AUTO_START or DEMAND_START
+wrapper.ntservice.starttype=AUTO_START
+
+# Allow service to interact with desktop (must be FALSE if account is specified)
+wrapper.ntservice.interactive=FALSE
+
+# Show a console - only takes effect if interactive is TRUE
+wrapper.ntservice.console=FALSE
+
+# The service runs as this user; Local System account is used if not specified
+# If prompt is true, the user will be prompted for the password. If false,
+# the password configuration property will be used.
+#wrapper.ntservice.account=.\username
+wrapper.ntservice.password.prompt=TRUE
+#wrapper.ntservice.password=xyz
+
+#*****************************************************************************
+# Wrapper UNIX Service Properties
+#*****************************************************************************
+# For UNIX, make sure it is daemonized
+wrapper.daemonize=TRUE
+
+#*****************************************************************************
+# Wrapper Shutdown Monitoring Properties
+#*****************************************************************************
+# File to be monitored - when anchor file is deleted, the instance will shutdown
+#wrapper.anchorfile=%RHQ_SERVER_HOME%\bin\anchor
+#wrapper.anchor.poll_interval=5
+
+# auto-restart on weird exit status - if exiting normally, just shutdown
+wrapper.on_exit.default=RESTART
+wrapper.on_exit.0=SHUTDOWN
+
+# immediately restart the JVM when java.lang.OutOfMemoryError is detected in its output
+wrapper.filter.trigger.1=java.lang.OutOfMemoryError
+wrapper.filter.action.1=RESTART
+
+# Determine when to restart or if an invocation simply failed on startup
+wrapper.max_failed_invocations=2
+wrapper.successful_invocation_time=300
+wrapper.startup.timeout=30
+
+# How to poll the VM to make sure it is not hung
+wrapper.ping.interval=30
+wrapper.ping.timeout=45
+wrapper.cpu.timeout=10
+
+# Allow our server some extra time to shutdown, since it may take a while to clear the
comm repo
+wrapper.shutdown.timeout=180
+wrapper.jvm_exit.timeout=180
+
+#*****************************************************************************
+# Wrapper Override Properties
+# wrapper.XXX properties defined in this included file override any
+# properties previously defined above.
+#*****************************************************************************
+#include %RHQ_SERVER_HOME%/bin/wrapper/rhq-storage-wrapper.inc
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
index d85a3b2..d64cfed 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/ControlCommand.java
@@ -116,9 +116,9 @@ public abstract class ControlCommand {
String syntax;
if (options.getOptions().isEmpty()) {
- syntax = "rhqctl.sh " + getName();
+ syntax = "rhqctl " + getName();
} else {
- syntax = "rhqctl.sh " + getName() + " [options]";
+ syntax = "rhqctl " + getName() + " [options]";
}
helpFormatter.setNewLine("\n");
@@ -158,7 +158,7 @@ public abstract class ControlCommand {
return getAgentBasedir().exists();
}
- protected boolean isStorageInstalled() {
+ protected boolean isStorageInstalled() {
return getStorageBasedir().exists();
}
@@ -217,11 +217,31 @@ public abstract class ControlCommand {
return file;
}
- protected String getExtension() {
+ protected org.apache.commons.exec.CommandLine getCommandLine(String scriptName,
String... args) {
+ org.apache.commons.exec.CommandLine result;
+
if (isWindows()) {
- return "bat";
+ result = new org.apache.commons.exec.CommandLine("cmd.exe");
+ result.addArgument("/C");
+ result.addArgument(scriptName + ".bat");
+ return result;
+ } else {
+ result = new org.apache.commons.exec.CommandLine("./" + scriptName
+ ".sh");
+ }
+
+ for (String arg : args) {
+ result.addArgument(arg);
}
- return "sh";
+
+ return result;
+ }
+
+ protected String getScript(String scriptName) {
+ if (isWindows()) {
+ return scriptName + ".bat";
+ }
+
+ return "./" + scriptName + ".sh";
}
protected boolean isWindows() {
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
index 8a6dd8f..54dc98e 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/RHQControl.java
@@ -45,7 +45,7 @@ public class RHQControl {
public void printUsage() {
HelpFormatter helpFormatter = new HelpFormatter();
- String syntax = "rhqctl.sh <cmd> [options]";
+ String syntax = "rhqctl <cmd> [options]";
String header = "\nwhere <cmd> is one of:";
helpFormatter.setOptPrefix("");
@@ -65,7 +65,7 @@ public class RHQControl {
} catch(UsageException e) {
printUsage();
} catch (RHQControlException e) {
- log.error(e);
+ log.error(e.getMessage() + " [Cause: " + e.getCause() +
"]");
}
}
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Console.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Console.java
index 31cd6ff..cbecd46 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Console.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Console.java
@@ -48,8 +48,7 @@ public class Console extends ControlCommand {
private Options options;
public Console() {
- options = new Options()
- .addOption(null, "storage", false, "Start the RHQ storage node
in the foreground")
+ options = new Options().addOption(null, "storage", false, "Start
the RHQ storage node in the foreground")
.addOption(null, "server", false, "Start the RHQ server in the
foreground")
.addOption(null, "agent", false, "Start the RHQ agent in the
foreground");
}
@@ -80,22 +79,22 @@ public class Console extends ControlCommand {
if (isStorageInstalled()) {
startStorageInForeground();
} else {
- log.warn("It appears that the storage node is not installed.
The --" + STORAGE_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the storage node is not installed.
The --" + STORAGE_OPTION
+ + " option will be ignored.");
}
} else if (option.equals(SERVER_OPTION)) {
if (isServerInstalled()) {
startServerInForeground();
} else {
- log.warn("It appears that the server is not installed. The
--" + SERVER_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the server is not installed. The
--" + SERVER_OPTION
+ + " option will be ignored.");
}
} else if (option.equals(AGENT_OPTION)) {
if (isAgentInstalled()) {
startAgentInForeground();
} else {
- log.warn("It appears that the agent is not installed. The
--" + AGENT_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the agent is not installed. The
--" + AGENT_OPTION
+ + " option will be ignored.");
}
} else {
throw new IllegalArgumentException(option + " is not a supported
option");
@@ -129,8 +128,7 @@ public class Console extends ControlCommand {
private void startServerInForeground() throws Exception {
log.debug("Starting RHQ server in foreground");
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-server." +
getExtension()).addArgument("console");
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-server", "console");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(binDir);
executor.setStreamHandler(new PumpStreamHandler());
@@ -145,33 +143,34 @@ public class Console extends ControlCommand {
File confDir = new File(agentHomeDir, "conf");
File agentConfigFile = new File(confDir, "agent-configuration.xml");
- Process process = new ProcessBuilder("./rhq-agent." + getExtension(),
"-c", agentConfigFile.getPath())
- .directory(agentBinDir)
-// .redirectOutput(ProcessBuilder.Redirect.INHERIT)
-// .redirectInput(ProcessBuilder.Redirect.INHERIT)
-// .redirectError(ProcessBuilder.Redirect.INHERIT)
+ //TODO: fix for windows
+ Process process = new ProcessBuilder(getScript("rhq-agent"),
"-c", agentConfigFile.getPath()).directory(
+ agentBinDir)
+ // .redirectOutput(ProcessBuilder.Redirect.INHERIT)
+ // .redirectInput(ProcessBuilder.Redirect.INHERIT)
+ // .redirectError(ProcessBuilder.Redirect.INHERIT)
.start();
-// .waitFor();
+ // .waitFor();
AgentInputStreamPipe pipe = new AgentInputStreamPipe(process.getInputStream());
pipe.start();
pipe.join();
-// final InputStream inputStream = process.getInputStream();
-// final CountDownLatch doneSignal = new CountDownLatch(1);
-// Thread agentThread = new Thread(new Runnable() {
-// @Override
-// public void run() {
-// InputStreamReader reader = new InputStreamReader(inputStream);
-// Scanner scanner = new Scanner(reader);
-// while (scanner.hasNextLine()) {
-// System.out.println(scanner.nextLine());
-// }
-// doneSignal.countDown();
-// }
-// });
-// agentThread.start();
-// doneSignal.await();
-// agentThread.join();
+ // final InputStream inputStream = process.getInputStream();
+ // final CountDownLatch doneSignal = new CountDownLatch(1);
+ // Thread agentThread = new Thread(new Runnable() {
+ // @Override
+ // public void run() {
+ // InputStreamReader reader = new InputStreamReader(inputStream);
+ // Scanner scanner = new Scanner(reader);
+ // while (scanner.hasNextLine()) {
+ // System.out.println(scanner.nextLine());
+ // }
+ // doneSignal.countDown();
+ // }
+ // });
+ // agentThread.start();
+ // doneSignal.await();
+ // agentThread.join();
}
private class AgentInputStreamPipe extends Thread {
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
index 2db81ce..c5c871d 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Install.java
@@ -74,20 +74,32 @@ public class Install extends ControlCommand {
public Install() {
options = new Options()
- .addOption(null, "storage", false, "Install RHQ storage node.
The default install directory will be " +
- DEFAULT_STORAGE_BASEDIR + ". Use the --storage-dir option to choose
an alternate directory.")
+ .addOption(
+ null,
+ "storage",
+ false,
+ "Install RHQ storage node. The default install directory will be
" + DEFAULT_STORAGE_BASEDIR
+ + ". Use the --storage-dir option to choose an alternate
directory.")
.addOption(null, "server", false, "Install RHQ server")
- .addOption(null, "agent", false, "Install RHQ agent. The
default install directory will be " +
- DEFAULT_AGENT_BASEDIR + ". Use the --agent-dir option to choose an
alternate directory.")
+ .addOption(
+ null,
+ "agent",
+ false,
+ "Install RHQ agent. The default install directory will be " +
DEFAULT_AGENT_BASEDIR
+ + ". Use the --agent-dir option to choose an alternate
directory.")
.addOption(null, "storage-dir", true, "The directory where the
storage node will be installed.")
.addOption(null, "agent-dir", true, "The directory where the
agent will be installed.")
- .addOption(null, SERVER_CONFIG_OPTION, true, "An alternate properties
file to use in place of the default " +
- "rhq-server.properties")
- .addOption(null, AGENT_CONFIG_OPTION, true, "An alternate XML file to
use in place of the default " +
- "agent-configuration.xml")
- .addOption(null, STORAGE_CONFIG_OPTION, true, "A properties file with
keys that correspond to option names " +
- "of the storage installer. Each property will be translated into an
option that is passed to the " +
- " storage installer. See example.storage.properties for
examples.");
+ .addOption(null, SERVER_CONFIG_OPTION, true,
+ "An alternate properties file to use in place of the default "
+ "rhq-server.properties")
+ .addOption(null, AGENT_CONFIG_OPTION, true,
+ "An alternate XML file to use in place of the default " +
"agent-configuration.xml")
+ .addOption(
+ null,
+ STORAGE_CONFIG_OPTION,
+ true,
+ "A properties file with keys that correspond to option names "
+ + "of the storage installer. Each property will be translated
into an option that is passed to the "
+ + " storage installer. See example.storage.properties for
examples.");
}
@Override
@@ -118,8 +130,8 @@ public class Install extends ControlCommand {
}
// if no options specified, then install whatever is installed
- if (!(commandLine.hasOption(STORAGE_OPTION) ||
commandLine.hasOption(SERVER_OPTION) ||
- commandLine.hasOption(AGENT_OPTION))) {
+ if (!(commandLine.hasOption(STORAGE_OPTION) ||
commandLine.hasOption(SERVER_OPTION) || commandLine
+ .hasOption(AGENT_OPTION))) {
replaceServerPropertiesIfNecessary(commandLine);
@@ -190,8 +202,8 @@ public class Install extends ControlCommand {
private List<String> validateOptions(CommandLine commandLine) {
List<String> errors = new LinkedList<String>();
- if (!(commandLine.hasOption(STORAGE_OPTION) ||
commandLine.hasOption(SERVER_OPTION) ||
- commandLine.hasOption(AGENT_OPTION))) {
+ if (!(commandLine.hasOption(STORAGE_OPTION) ||
commandLine.hasOption(SERVER_OPTION) || commandLine
+ .hasOption(AGENT_OPTION))) {
if (commandLine.hasOption(SERVER_CONFIG_OPTION) &&
!isServerInstalled()) {
File serverConfig = new
File(commandLine.getOptionValue(SERVER_CONFIG_OPTION));
validateServerConfigOption(serverConfig, errors);
@@ -219,14 +231,14 @@ public class Install extends ControlCommand {
}
}
- if (commandLine.hasOption(SERVER_OPTION) && !isStorageInstalled()
&&
- commandLine.hasOption(SERVER_CONFIG_OPTION)) {
+ if (commandLine.hasOption(SERVER_OPTION) && !isStorageInstalled()
+ && commandLine.hasOption(SERVER_CONFIG_OPTION)) {
File serverConfig = new
File(commandLine.getOptionValue(SERVER_CONFIG_OPTION));
validateServerConfigOption(serverConfig, errors);
}
- if (commandLine.hasOption(AGENT_OPTION) && !isAgentInstalled()
&&
- commandLine.hasOption(AGENT_CONFIG_OPTION)) {
+ if (commandLine.hasOption(AGENT_OPTION) && !isAgentInstalled()
+ && commandLine.hasOption(AGENT_CONFIG_OPTION)) {
File agentConfig = new
File(commandLine.getOptionValue(AGENT_CONFIG_OPTION));
validateAgentConfigOption(agentConfig, errors);
}
@@ -237,34 +249,34 @@ public class Install extends ControlCommand {
private void validateServerConfigOption(File serverConfig, List<String> errors)
{
if (!serverConfig.exists()) {
- errors.add("The --server-config option has as its value a file that does
not exist [" +
- serverConfig.getAbsolutePath() + "]");
+ errors.add("The --server-config option has as its value a file that does
not exist ["
+ + serverConfig.getAbsolutePath() + "]");
} else if (serverConfig.isDirectory()) {
- errors.add("The --server-config option has as its value a path that is a
directory [" +
- serverConfig.getAbsolutePath() + "]. It should be a properties file
that replaces the " +
- "default rhq-server.properties");
+ errors.add("The --server-config option has as its value a path that is a
directory ["
+ + serverConfig.getAbsolutePath() + "]. It should be a properties
file that replaces the "
+ + "default rhq-server.properties");
}
}
private void validateAgentConfigOption(File agentConfig, List<String> errors)
{
if (!agentConfig.exists()) {
- errors.add("The --agent-config option has as its value a file that does
not exist [" +
- agentConfig.getAbsolutePath() + "]");
+ errors.add("The --agent-config option has as its value a file that does
not exist ["
+ + agentConfig.getAbsolutePath() + "]");
} else if (agentConfig.isDirectory()) {
- errors.add("The --agent-config option has as its value a path that is a
directory [" +
- agentConfig.getAbsolutePath() + "]. It should be an XML file that
replaces the default " +
- "agent-configuration.xml");
+ errors.add("The --agent-config option has as its value a path that is a
directory ["
+ + agentConfig.getAbsolutePath() + "]. It should be an XML file that
replaces the default "
+ + "agent-configuration.xml");
}
}
private void validateStorageConfigOption(File storageConfig, List<String>
errors) {
if (!storageConfig.exists()) {
- errors.add("The --storage-config option has as its value a file that
does not exist [" +
- storageConfig.getAbsolutePath() + "]");
+ errors.add("The --storage-config option has as its value a file that
does not exist ["
+ + storageConfig.getAbsolutePath() + "]");
} else if (storageConfig.isDirectory()) {
- errors.add("The --storage-config option has as its value a path that is
a directory [" +
- storageConfig.getAbsolutePath() + "]. It should be a properties file
with keys that " +
- "correspond to options for the storage installer.");
+ errors.add("The --storage-config option has as its value a path that is
a directory ["
+ + storageConfig.getAbsolutePath() + "]. It should be a properties
file with keys that "
+ + "correspond to options for the storage installer.");
}
}
@@ -289,9 +301,8 @@ public class Install extends ControlCommand {
putProperty(RHQ_STORAGE_BASEDIR_PROP, storageBasedir.getAbsolutePath());
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-storage-installer." +
getExtension()).addArgument("--dir")
- .addArgument(storageBasedir.getAbsolutePath());
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-storage-installer", "--dir",
+ storageBasedir.getAbsolutePath());
if (rhqctlCommandLine.hasOption(STORAGE_CONFIG_OPTION)) {
String[] args =
toArray(loadStorageProperties(rhqctlCommandLine.getOptionValue(STORAGE_CONFIG_OPTION)));
@@ -323,8 +334,7 @@ public class Install extends ControlCommand {
}
private void startRHQServerForInstallation() throws Exception {
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-server." + getExtension()).addArgument("start");
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-server", "start");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(binDir);
@@ -332,8 +342,7 @@ public class Install extends ControlCommand {
executor.execute(commandLine, new DefaultExecuteResultHandler());
- commandLine = new
org.apache.commons.exec.CommandLine("./rhq-installer." + getExtension())
- .addArgument("--test");
+ commandLine = getCommandLine("rhq-installer", "--test");
executor = new DefaultExecutor();
executor.setWorkingDirectory(binDir);
@@ -346,8 +355,7 @@ public class Install extends ControlCommand {
private void installRHQServer() throws Exception {
log.debug("Installing RHQ server");
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-installer." + getExtension());
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-installer");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(binDir);
executor.setStreamHandler(new PumpStreamHandler());
@@ -382,8 +390,7 @@ public class Install extends ControlCommand {
putProperty(RHQ_AGENT_BASEDIR_PROP, agentBasedir.getAbsolutePath());
org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine("java")
- .addArgument("-jar")
- .addArgument(agentInstallerJar.getAbsolutePath())
+
.addArgument("-jar").addArgument(agentInstallerJar.getAbsolutePath())
.addArgument("--install=" +
agentBasedir.getParentFile().getAbsolutePath());
Executor executor = new DefaultExecutor();
@@ -435,8 +442,7 @@ public class Install extends ControlCommand {
private void startAgent(File agentBasedir) throws Exception {
File agentBinDir = new File(agentBasedir, "bin");
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-agent-wrapper." +
getExtension()).addArgument("start");
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-agent-wrapper", "start");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(agentBinDir);
@@ -456,8 +462,7 @@ public class Install extends ControlCommand {
try {
StreamUtil.copy(new FileReader(newServerProperties), new
FileWriter(defaultServerProps));
} catch (IOException e) {
- throw new RHQControlException("Failed to replace " +
defaultServerProps + " with " + newServerProperties,
- e);
+ throw new RHQControlException("Failed to replace " +
defaultServerProps + " with " + newServerProperties, e);
}
}
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
index f58ac4c..942f6ee 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Start.java
@@ -46,8 +46,7 @@ public class Start extends ControlCommand {
private Options options;
public Start() {
- options = new Options()
- .addOption(null, STORAGE_OPTION, false, "Start RHQ storage node")
+ options = new Options().addOption(null, STORAGE_OPTION, false, "Start RHQ
storage node")
.addOption(null, SERVER_OPTION, false, "Start RHQ server")
.addOption(null, AGENT_OPTION, false, "Start RHQ agent");
}
@@ -86,24 +85,24 @@ public class Start extends ControlCommand {
if (isStorageInstalled()) {
startStorage();
} else {
- log.warn("It appears that the storage node is not installed.
The --" + STORAGE_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the storage node is not installed.
The --" + STORAGE_OPTION
+ + " option will be ignored.");
}
}
if (commandLine.hasOption(SERVER_OPTION)) {
if (isServerInstalled()) {
startRHQServer();
} else {
- log.warn("It appears that the server is not installed. The
--" + SERVER_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the server is not installed. The
--" + SERVER_OPTION
+ + " option will be ignored.");
}
}
if (commandLine.hasOption(AGENT_OPTION)) {
if (isAgentInstalled()) {
startAgent();
} else {
- log.warn("It appears that the agent is not installed. The
--" + AGENT_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the agent is not installed. The
--" + AGENT_OPTION
+ + " option will be ignored.");
}
}
}
@@ -143,8 +142,7 @@ public class Start extends ControlCommand {
private void startRHQServer() throws Exception {
log.debug("Starting RHQ server");
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-server." + getExtension()).addArgument("start");
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-server", "start");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(binDir);
executor.setStreamHandler(new PumpStreamHandler());
@@ -156,8 +154,7 @@ public class Start extends ControlCommand {
File agentBinDir = new File(getAgentBasedir(), "bin");
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-agent-wrapper." +
getExtension()).addArgument("start");
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-agent-wrapper", "start");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(agentBinDir);
executor.setStreamHandler(new PumpStreamHandler());
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
index 32344c9..0aa054c 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Status.java
@@ -46,8 +46,7 @@ public class Status extends ControlCommand {
private Options options;
public Status() {
- options = new Options()
- .addOption(null, STORAGE_OPTION, false, "Check status of RHQ storage
node")
+ options = new Options().addOption(null, STORAGE_OPTION, false, "Check status
of RHQ storage node")
.addOption(null, SERVER_OPTION, false, "Check status of RHQ
server")
.addOption(null, AGENT_OPTION, false, "Check status of RHQ
agent");
}
@@ -86,24 +85,24 @@ public class Status extends ControlCommand {
if (isStorageInstalled()) {
checkStorageStatus();
} else {
- log.warn("It appears that the storage node is not installed.
The --" + STORAGE_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the storage node is not installed.
The --" + STORAGE_OPTION
+ + " option will be ignored.");
}
}
if (commandLine.hasOption(SERVER_OPTION)) {
if (isServerInstalled()) {
checkServerStatus();
} else {
- log.warn("It appears that the server is not installed. The
--" + SERVER_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the server is not installed. The
--" + SERVER_OPTION
+ + " option will be ignored.");
}
}
if (commandLine.hasOption(AGENT_OPTION)) {
if (isAgentInstalled()) {
checkAgentStatus();
} else {
- log.warn("It appears that the agent is not installed. The
--" + AGENT_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the agent is not installed. The
--" + AGENT_OPTION
+ + " option will be ignored.");
}
}
}
@@ -129,8 +128,7 @@ public class Status extends ControlCommand {
private void checkServerStatus() throws Exception {
log.debug("Checking RHQ server status");
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-server." + getExtension()).addArgument("status");
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-server", "status");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(binDir);
executor.setStreamHandler(new PumpStreamHandler());
@@ -142,8 +140,7 @@ public class Status extends ControlCommand {
File agentBinDir = new File(getAgentBasedir(), "bin");
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-agent-wrapper." +
getExtension()).addArgument("status");
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-agent-wrapper", "status");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(agentBinDir);
executor.setStreamHandler(new PumpStreamHandler());
diff --git
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Stop.java
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Stop.java
index 13fb1f2..5c5355a 100644
---
a/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Stop.java
+++
b/modules/enterprise/server/server-control/src/main/java/org/rhq/server/control/command/Stop.java
@@ -44,10 +44,8 @@ public class Stop extends ControlCommand {
private Options options;
public Stop() {
- options = new Options()
- .addOption(null, "storage", false, "Stop RHQ storage
node")
- .addOption(null, "server", false, "Stop RHQ server")
- .addOption(null, "agent", false, "Stop RHQ agent");
+ options = new Options().addOption(null, "storage", false, "Stop
RHQ storage node")
+ .addOption(null, "server", false, "Stop RHQ
server").addOption(null, "agent", false, "Stop RHQ agent");
}
@Override
@@ -84,24 +82,24 @@ public class Stop extends ControlCommand {
if (isStorageInstalled()) {
stopStorage();
} else {
- log.warn("It appears that the storage node is not installed.
The --" + STORAGE_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the storage node is not installed.
The --" + STORAGE_OPTION
+ + " option will be ignored.");
}
}
if (commandLine.hasOption(SERVER_OPTION)) {
if (isServerInstalled()) {
stopRHQServer();
} else {
- log.warn("It appears that the server is not installed. The
--" + SERVER_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the server is not installed. The
--" + SERVER_OPTION
+ + " option will be ignored.");
}
}
if (commandLine.hasOption(AGENT_OPTION)) {
if (isAgentInstalled()) {
stopAgent();
} else {
- log.warn("It appears that the agent is not installed. The
--" + AGENT_OPTION +
- " option will be ignored.");
+ log.warn("It appears that the agent is not installed. The
--" + AGENT_OPTION
+ + " option will be ignored.");
}
}
}
@@ -133,8 +131,7 @@ public class Stop extends ControlCommand {
String pid = getServerPid();
if (pid != null) {
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-server." +
getExtension()).addArgument("stop");
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-server", "stop");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(binDir);
executor.setStreamHandler(new PumpStreamHandler());
@@ -149,8 +146,7 @@ public class Stop extends ControlCommand {
String pid = getAgentPid();
if (pid != null) {
- org.apache.commons.exec.CommandLine commandLine = new
org.apache.commons.exec.CommandLine(
- "./rhq-agent-wrapper." +
getExtension()).addArgument("stop");
+ org.apache.commons.exec.CommandLine commandLine =
getCommandLine("rhq-agent-wrapper", "stop");
Executor executor = new DefaultExecutor();
executor.setWorkingDirectory(agentBinDir);
executor.setStreamHandler(new PumpStreamHandler());
commit f7b452cf67032d94cce347662888f5b79587c0fa
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Apr 24 15:59:52 2013 -0400
Add -Pdev copy of jars to dev-container
diff --git a/modules/common/cassandra-installer/pom.xml
b/modules/common/cassandra-installer/pom.xml
index 17a87f5..6563d2b 100644
--- a/modules/common/cassandra-installer/pom.xml
+++ b/modules/common/cassandra-installer/pom.xml
@@ -104,4 +104,62 @@
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+
<rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+
<rhq.deploymentDir>${rhq.containerDir}/modules/org/rhq/rhq-cassandra-installer/main</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${rhq.deploymentDir}" />
+ <property name="deployment.file"
location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}"
basedir="${project.build.outputDirectory}" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.file"
location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
</project>
diff --git a/modules/enterprise/server/server-control/pom.xml
b/modules/enterprise/server/server-control/pom.xml
index d0724f6..11c1f92 100644
--- a/modules/enterprise/server/server-control/pom.xml
+++ b/modules/enterprise/server/server-control/pom.xml
@@ -97,4 +97,62 @@
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>dev</id>
+
+ <properties>
+ <rhq.rootDir>../../../..</rhq.rootDir>
+
<rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+
<rhq.deploymentDir>${rhq.containerDir}/modules/org/rhq/rhq-server-control/main</rhq.deploymentDir>
+ </properties>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+
+ <execution>
+ <id>deploy</id>
+ <phase>compile</phase>
+ <configuration>
+ <target>
+ <mkdir dir="${rhq.deploymentDir}" />
+ <property name="deployment.file"
location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Updating ${deployment.file}...</echo>
+ <jar destfile="${deployment.file}"
basedir="${project.build.outputDirectory}" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <execution>
+ <id>undeploy</id>
+ <phase>clean</phase>
+ <configuration>
+ <target>
+ <property name="deployment.file"
location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+ <echo>*** Deleting ${deployment.file}...</echo>
+ <delete file="${deployment.file}" />
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
</project>
commit 3a2810993619af282b6e5aeb7a7d0e48772c0119
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Wed Apr 24 15:55:39 2013 -0400
Fix typo in property name
diff --git a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/deploy.xml
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/deploy.xml
index 8369389..19d5647 100644
--- a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/deploy.xml
+++ b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/bundle/deploy.xml
@@ -114,7 +114,7 @@
defaultValue=""
type="string"/>
- <rhq:input-property name="rhq.casandra.native_transport_max_threads"
+ <rhq:input-property name="rhq.cassandra.native_transport_max_threads"
description="The maximum number of threads handling native
CQL requests."
required="false"
defaultValue="64"
diff --git
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
index f2c14ce..1e7d1b8 100644
---
a/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
+++
b/modules/common/cassandra-ccm/cassandra-ccm-core/src/main/java/org/rhq/cassandra/DeploymentOptions.java
@@ -141,7 +141,7 @@ public class DeploymentOptions {
setNumTokens(Integer.valueOf(loadProperty("rhq.cassandra.num-tokens",
properties)));
setNativeTransportPort(Integer.valueOf(loadProperty("rhq.cassandra.native-transport-port",
properties)));
setRpcPort(Integer.valueOf(loadProperty("rhq.cassandra.rpc-port",
properties)));
-
setNativeTransportMaxThreads(Integer.valueOf(loadProperty("rhq.casandra.native-transport-max-threads",
+
setNativeTransportMaxThreads(Integer.valueOf(loadProperty("rhq.cassandra.native-transport-max-threads",
properties)));
setUsername(loadProperty("rhq.cassandra.username", properties));
setPassword(loadProperty("rhq.cassandra.password", properties));
@@ -365,7 +365,7 @@ public class DeploymentOptions {
/**
* @return The max number of threads to handle CQL requests
*/
- @DeploymentProperty(name = "rhq.casandra.native_transport_max_threads")
+ @DeploymentProperty(name = "rhq.cassandra.native_transport_max_threads")
public Integer getNativeTransportMaxThreads() {
return nativeTransportMaxThreads;
}