ARTEMIS-564 Fixing runtime with folders & spaces

https://issues.apache.org/jira/browse/ARTEMIS-564
This commit is contained in:
Clebert Suconic 2016-06-08 13:56:45 -04:00
parent 17ffcd48c2
commit 76af1f33d0
7 changed files with 30 additions and 32 deletions

View File

@ -19,6 +19,7 @@ package org.apache.activemq.artemis.cli.commands;
import java.io.File;
import io.airlift.airline.Command;
import org.apache.activemq.artemis.dto.BrokerDTO;
@Command(name = "stop", description = "stops the broker instance")
public class Stop extends Configurable {
@ -26,14 +27,9 @@ public class Stop extends Configurable {
@Override
public Object execute(ActionContext context) throws Exception {
super.execute(context);
BrokerDTO broker = getBrokerDTO();
String value = getConfiguration();
if (value != null && value.startsWith("xml:")) {
value = value.substring("xml:".length());
}
File file = new File(value).getParentFile();
File file = broker.server.getConfigurationFile().getParentFile();
File stopFile = new File(file, "STOP_ME");

View File

@ -96,9 +96,9 @@ start() {
fi
if [ -z "$ARTEMIS_USER" -o `id -un` = "$ARTEMIS_USER" ] ; then
nohup ${ARTEMIS_INSTANCE}/bin/artemis run > /dev/null 2> /dev/null &
nohup "${ARTEMIS_INSTANCE}/bin/artemis" run > /dev/null 2> /dev/null &
else
sudo -n -u ${ARTEMIS_USER} nohup ${ARTEMIS_INSTANCE}/bin/artemis run > /dev/null 2> /dev/null &
sudo -n -u ${ARTEMIS_USER} nohup "${ARTEMIS_INSTANCE}/bin/artemis" run > /dev/null 2> /dev/null &
fi
echo $! > "${PID_FILE}"

View File

@ -22,10 +22,14 @@
<name>ActiveMQ Artemis: ${artemis.instance.name} @ ${host}</name>
<description>Apache ActiveMQ Artemis is a reliable messaging broker</description>
<env name="ARTEMIS_HOME" value="${artemis.home}"/>
<env name="ARTEMIS_INSTANCE" value="${artemis.instance}"/>
<logpath>${artemis.instance}\log</logpath>
<logmode>roll</logmode>
<executable>java</executable>
<argument>-Xbootclasspath/a:%ARTEMIS_HOME%\lib\${logmanager}</argument>
<argument>-XX:+UseParallelGC</argument>
<argument>-XX:+AggressiveOpts</argument>
<argument>-XX:+UseFastAccessorMethods</argument>
@ -40,13 +44,12 @@
-->
<argument>-classpath</argument>
<argument>"${artemis.home}\lib\artemis-boot.jar"</argument>
<argument>-Dartemis.home="${artemis.home}"</argument>
<argument>-Dartemis.instance="${artemis.instance}"</argument>
<argument>-Ddata.dir="${artemis.instance}\data"</argument>
<argument>%ARTEMIS_HOME%\lib\artemis-boot.jar</argument>
<argument>-Dartemis.home=%ARTEMIS_HOME%</argument>
<argument>-Dartemis.instance=%ARTEMIS_INSTANCE%</argument>
<argument>-Djava.util.logging.manager=org.jboss.logmanager.LogManager</argument>
<argument>-Dlogging.configuration="file:${artemis.instance}\etc\logging.properties"</argument>
<argument>-Djava.security.auth.login.config="${artemis.instance}\etc\login.config"</argument>
<argument>-Dlogging.configuration=file:%ARTEMIS_INSTANCE%\etc\logging.properties</argument>
<argument>-Djava.security.auth.login.config=%ARTEMIS_INSTANCE%\etc\login.config</argument>
<!-- Debug args: Uncomment to enable debug

View File

@ -21,11 +21,11 @@ setlocal
if NOT "%ARTEMIS_INSTANCE%"=="" goto CHECK_ARTEMIS_INSTANCE
PUSHD .
CD %~dp0..
set ARTEMIS_INSTANCE=%CD%
set ARTEMIS_INSTANCE="%CD%"
POPD
:CHECK_ARTEMIS_INSTANCE
if exist "%ARTEMIS_INSTANCE%\bin\artemis.cmd" goto CHECK_JAVA
if exist %ARTEMIS_INSTANCE%\bin\artemis.cmd goto CHECK_JAVA
:NO_HOME
echo ARTEMIS_INSTANCE environment variable is set incorrectly. Please set ARTEMIS_INSTANCE.
@ -53,17 +53,17 @@ set ARTEMIS_DATA_DIR=%ARTEMIS_INSTANCE%\data
set ARTEMIS_LOG_MANAGER=org.jboss.logmanager.LogManager
rem "Load Profile Config"
call "%ARTEMIS_INSTANCE%\etc\artemis.profile.cmd" %*
call %ARTEMIS_INSTANCE%\etc\artemis.profile.cmd %*
rem "Create full JVM Args"
set JVM_ARGS=%JAVA_ARGS%
if not "%ARTEMIS_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ARTEMIS_CLUSTER_PROPS%
set JVM_ARGS=%JVM_ARGS% -classpath "%ARTEMIS_HOME%\lib\artemis-boot.jar"
set JVM_ARGS=%JVM_ARGS% -Dartemis.home="%ARTEMIS_HOME%"
set JVM_ARGS=%JVM_ARGS% -Dartemis.instance="%ARTEMIS_INSTANCE%"
set JVM_ARGS=%JVM_ARGS% -Ddata.dir="%ARTEMIS_DATA_DIR%"
set JVM_ARGS=%JVM_ARGS% -Djava.util.logging.manager="%ARTEMIS_LOG_MANAGER%"
set JVM_ARGS=%JVM_ARGS% -Dlogging.configuration="%ARTEMIS_LOGGING_CONF%"
set JVM_ARGS=%JVM_ARGS% -classpath %ARTEMIS_HOME%\lib\artemis-boot.jar
set JVM_ARGS=%JVM_ARGS% -Dartemis.home=%ARTEMIS_HOME%
set JVM_ARGS=%JVM_ARGS% -Dartemis.instance=%ARTEMIS_INSTANCE%
set JVM_ARGS=%JVM_ARGS% -Ddata.dir=%ARTEMIS_DATA_DIR%
set JVM_ARGS=%JVM_ARGS% -Djava.util.logging.manager=%ARTEMIS_LOG_MANAGER%
set JVM_ARGS=%JVM_ARGS% -Dlogging.configuration=%ARTEMIS_LOGGING_CONF%
if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS%
"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.Artemis %*

View File

@ -1,3 +1,4 @@
@echo off
rem Licensed to the Apache Software Foundation (ASF) under one
rem or more contributor license agreements. See the NOTICE file
rem distributed with this work for additional information
@ -15,8 +16,8 @@ rem KIND, either express or implied. See the License for the
rem specific language governing permissions and limitations
rem under the License.
set ARTEMIS_HOME=${artemis.home}
set ARTEMIS_INSTANCE=${artemis.instance}
set ARTEMIS_HOME="${artemis.home}"
set ARTEMIS_INSTANCE="${artemis.instance}"
rem Cluster Properties: Used to pass arguments to ActiveMQ Artemis which can be referenced in broker.xml
rem set ARTEMIS_CLUSTER_PROPS=-Dactivemq.remoting.default.port=61617 -Dactivemq.remoting.amqp.port=5673 -Dactivemq.remoting.stomp.port=61614 -Dactivemq.remoting.hornetq.port=5446

View File

@ -31,8 +31,6 @@ under the License.
<h1>Getting Started</h1>
<b>Note (Windows users):</b> The broker currently does not support spaces in path names. For this reason the broker should be placed in a directory with no spaces in it's absolute path.<br><br>
<b>Note (Windows users):</b> Examples below use the shell script `artemis` for use with linux, Windows users should use the `artemis.cmd` script with the same parameters.<br><br>
<h2>Creating a broker</h2>

View File

@ -21,11 +21,11 @@ setlocal
if NOT "%ARTEMIS_HOME%"=="" goto CHECK_ARTEMIS_HOME
PUSHD .
CD %~dp0..
set ARTEMIS_HOME=%CD%
set ARTEMIS_HOME="%CD%"
POPD
:CHECK_ARTEMIS_HOME
if exist "%ARTEMIS_HOME%\bin\artemis.cmd" goto CHECK_JAVA
if exist %ARTEMIS_HOME%\bin\artemis.cmd goto CHECK_JAVA
:NO_HOME
echo ARTEMIS_HOME environment variable is set incorrectly. Please set ARTEMIS_HOME.
@ -53,8 +53,8 @@ set JAVA_ARGS=-XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods
rem "Create full JVM Args"
set JVM_ARGS=%JAVA_ARGS%
if not "%ARTEMIS_CLUSTER_PROPS%"=="" set JVM_ARGS=%JVM_ARGS% %ARTEMIS_CLUSTER_PROPS%
set JVM_ARGS=%JVM_ARGS% -classpath "%ARTEMIS_HOME%\lib\artemis-boot.jar"
set JVM_ARGS=%JVM_ARGS% -Dartemis.home="%ARTEMIS_HOME%"
set JVM_ARGS=%JVM_ARGS% -classpath %ARTEMIS_HOME%\lib\artemis-boot.jar
set JVM_ARGS=%JVM_ARGS% -Dartemis.home=%ARTEMIS_HOME%
if not "%DEBUG_ARGS%"=="" set JVM_ARGS=%JVM_ARGS% %DEBUG_ARGS%
"%_JAVACMD%" %JVM_ARGS% org.apache.activemq.artemis.boot.Artemis %*