AMQ-9434: Support space in ActiveMQ base directory

(cherry picked from commit 6bae734088)
This commit is contained in:
JB Onofré 2024-03-01 16:01:18 +01:00 committed by Jean-Baptiste Onofré
parent 201a0a842d
commit 9b7e1c774a
1 changed files with 8 additions and 8 deletions

View File

@ -171,7 +171,7 @@ if ( basename $0 | grep "activemq-instance-" > /dev/null);then
ACTIVEMQ_CONFIGS="/etc/default/activemq-instance-${INST} $HOME/.activemqrc-instance-${INST}" ACTIVEMQ_CONFIGS="/etc/default/activemq-instance-${INST} $HOME/.activemqrc-instance-${INST}"
echo "INFO: Using alternative activemq configuration files: $ACTIVEMQ_CONFIGS" echo "INFO: Using alternative activemq configuration files: $ACTIVEMQ_CONFIGS"
else else
ACTIVEMQ_CONFIGS="/etc/default/activemq $HOME/.activemqrc $ACTIVEMQ_HOME/bin/setenv" ACTIVEMQ_CONFIGS="/etc/default/activemq $HOME/.activemqrc \"$ACTIVEMQ_HOME\"/bin/setenv"
fi fi
# load activemq configuration # load activemq configuration
@ -199,7 +199,7 @@ if [ "$CONFIG_LOAD" != "yes" ];then
fi fi
if [ -z "$ACTIVEMQ_OPTS" ] ; then if [ -z "$ACTIVEMQ_OPTS" ] ; then
ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=$ACTIVEMQ_CONF/login.config" ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=\"$ACTIVEMQ_CONF\"/login.config"
fi fi
@ -358,9 +358,9 @@ invokeJar(){
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \ -Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
-Djolokia.conf=\"${JOLOKIA_CONF}\" \ -Djolokia.conf=\"${JOLOKIA_CONF}\" \
$ACTIVEMQ_CYGWIN \ $ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS >> $ACTIVEMQ_OUT 2>&1 & -jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS >> \"$ACTIVEMQ_OUT\" 2>&1 &
RET=\"\$?\"; APID=\"\$!\"; RET=\"\$?\"; APID=\"\$!\";
echo \$APID > "${PIDFILE}"; echo \$APID > \"${PIDFILE}\";
echo \"INFO: pidfile created : '${PIDFILE}' (pid '\$APID')\";exit \$RET" $DOIT_POSTFIX echo \"INFO: pidfile created : '${PIDFILE}' (pid '\$APID')\";exit \$RET" $DOIT_POSTFIX
RET="$?" RET="$?"
elif [ -n "$TASK_TODO" ] && [ "$TASK_TODO" = "stop" ];then elif [ -n "$TASK_TODO" ] && [ "$TASK_TODO" = "stop" ];then
@ -389,7 +389,7 @@ invokeJar(){
$ACTIVEMQ_CYGWIN \ $ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS --pid $SPID & -jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS --pid $SPID &
RET=\"\$?\"; APID=\"\$!\"; RET=\"\$?\"; APID=\"\$!\";
echo \$APID > "${PIDFILE}.stop"; exit \$RET" $DOIT_POSTFIX echo \$APID > \"${PIDFILE}.stop\"; exit \$RET" $DOIT_POSTFIX
RET="$?" RET="$?"
else else
$EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \ $EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \
@ -434,7 +434,7 @@ invokeJar(){
checkRunning(){ checkRunning(){
local pidfile="${1}" local pidfile="${1}"
if [ -f $pidfile ]; then if [ -f "$pidfile" ]; then
if [ -z "`cat "$pidfile"`" ];then if [ -z "`cat "$pidfile"`" ];then
echo "ERROR: Pidfile '$pidfile' exists but contains no pid" echo "ERROR: Pidfile '$pidfile' exists but contains no pid"
return 2 return 2
@ -463,7 +463,7 @@ checkRunning(){
invoke_status(){ invoke_status(){
if ( checkRunning "$ACTIVEMQ_PIDFILE" );then if ( checkRunning "$ACTIVEMQ_PIDFILE" );then
PID="`cat $ACTIVEMQ_PIDFILE`" PID="`cat \"$ACTIVEMQ_PIDFILE\"`"
echo "ActiveMQ is running (pid '$PID')" echo "ActiveMQ is running (pid '$PID')"
exit 0 exit 0
fi fi
@ -538,7 +538,7 @@ invoke_console(){
invoke_kill(){ invoke_kill(){
if ( checkRunning "$ACTIVEMQ_PIDFILE" );then if ( checkRunning "$ACTIVEMQ_PIDFILE" );then
ACTIVEMQ_PID="`cat ${ACTIVEMQ_PIDFILE}`" ACTIVEMQ_PID="`cat \"${ACTIVEMQ_PIDFILE}\"`"
echo "INFO: sending SIGKILL to pid '$ACTIVEMQ_PID'" echo "INFO: sending SIGKILL to pid '$ACTIVEMQ_PID'"
kill -KILL $ACTIVEMQ_PID kill -KILL $ACTIVEMQ_PID
RET="$?" RET="$?"