Set the java.io.tmpdir to be the ${ACTIVEM_BASE}/tmp directory. This way it's easy to find and delete temp files (like the ones jetty uses).

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1292413 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2012-02-22 17:35:37 +00:00
parent b5e294372f
commit a7873fc8ce
6 changed files with 29 additions and 5 deletions

View File

@ -53,6 +53,13 @@ public class Main {
private Set<File> activeMQClassPath = new HashSet<File>(5); private Set<File> activeMQClassPath = new HashSet<File>(5);
public static void main(String[] args) { public static void main(String[] args) {
// Create the tmpdir if it does not exist yet..
File tmpdir = new File(System.getProperty("java.io.tmpdir"));
if(!tmpdir.exists()) {
tmpdir.mkdirs();
}
Main app = new Main(); Main app = new Main();
// Convert arguments to collection for easier management // Convert arguments to collection for easier management

View File

@ -6,4 +6,4 @@ public class LowercasingPasswordFactory implements PasswordFactory {
return password.toLowerCase(); return password.toLowerCase();
} }
}; }

View File

@ -104,6 +104,10 @@ if [ -z "$ACTIVEMQ_DATA" ] ; then
ACTIVEMQ_DATA="$ACTIVEMQ_BASE/data" ACTIVEMQ_DATA="$ACTIVEMQ_BASE/data"
fi fi
if [ -z "$ACTIVEMQ_TMP" ] ; then
ACTIVEMQ_TMP="$ACTIVEMQ_BASE/tmp"
fi
setCurrentUser(){ setCurrentUser(){
CUSER=`whoami 2>/dev/null` CUSER=`whoami 2>/dev/null`
@ -334,6 +338,7 @@ if [ "$OSTYPE" = "cygwin" ];then
JAVA_HOME=`cygpath --windows "$JAVA_HOME"` JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
CLASSPATH=`cygpath --path --windows "$CLASSPATH"` CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
CYGHOME=`cygpath --windows "$HOME"` CYGHOME=`cygpath --windows "$HOME"`
ACTIVEMQ_TMP=`cygpath --windows "$ACTIVEMQ_TMP"`
if [ -n "$CYGHOME" ]; then if [ -n "$CYGHOME" ]; then
ACTIVEMQ_CYGWIN="-Dcygwin.user.home=\"$CYGHOME\"" ACTIVEMQ_CYGWIN="-Dcygwin.user.home=\"$CYGHOME\""
fi fi
@ -382,6 +387,7 @@ invokeJar(){
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \ -Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \ -Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \ -Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
-Djava.io.tmpdir=\"${ACTIVEMQ_TMP}\" \
$ACTIVEMQ_CYGWIN \ $ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS >/dev/null 2>&1 & -jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS >/dev/null 2>&1 &
RET=\"\$?\"; APID=\"\$!\"; RET=\"\$?\"; APID=\"\$!\";
@ -396,6 +402,7 @@ invokeJar(){
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \ -Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \ -Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \ -Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
-Djava.io.tmpdir=\"${ACTIVEMQ_TMP}\" \
$ACTIVEMQ_CYGWIN \ $ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS --pid $PID & -jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS --pid $PID &
RET=\"\$?\"; APID=\"\$!\"; RET=\"\$?\"; APID=\"\$!\";
@ -408,6 +415,7 @@ invokeJar(){
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \ -Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \ -Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \ -Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
-Djava.io.tmpdir=\"${ACTIVEMQ_TMP}\" \
$ACTIVEMQ_CYGWIN \ $ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS" $DOIT_POSTFIX -jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS" $DOIT_POSTFIX
RET="$?" RET="$?"

View File

@ -116,6 +116,10 @@ if [ -z "$ACTIVEMQ_BASE" ] ; then
ACTIVEMQ_BASE="$ACTIVEMQ_HOME" ACTIVEMQ_BASE="$ACTIVEMQ_HOME"
fi fi
if [ -z "$ACTIVEMQ_TMP" ] ; then
ACTIVEMQ_TMP="$ACTIVEMQ_BASE/tmp"
fi
# Active MQ configuration directory # Active MQ configuration directory
if [ -z "$ACTIVEMQ_CONF" ] ; then if [ -z "$ACTIVEMQ_CONF" ] ; then
ACTIVEMQ_CONF="$ACTIVEMQ_BASE/conf" ACTIVEMQ_CONF="$ACTIVEMQ_BASE/conf"
@ -132,6 +136,7 @@ if $cygwin; then
ACTIVEMQ_BASE=`cygpath --windows "$ACTIVEMQ_BASE"` ACTIVEMQ_BASE=`cygpath --windows "$ACTIVEMQ_BASE"`
ACTIVEMQ_CONF=`cygpath --windows "$ACTIVEMQ_CONF"` ACTIVEMQ_CONF=`cygpath --windows "$ACTIVEMQ_CONF"`
ACTIVEMQ_DATA=`cygpath --windows "$ACTIVEMQ_DATA"` ACTIVEMQ_DATA=`cygpath --windows "$ACTIVEMQ_DATA"`
ACTIVEMQ_TMP=`cygpath --windows "$ACTIVEMQ_TMP"`
ACTIVEMQ_CLASSPATH=`cygpath --path --windows "$ACTIVEMQ_CLASSPATH"` ACTIVEMQ_CLASSPATH=`cygpath --path --windows "$ACTIVEMQ_CLASSPATH"`
JAVA_HOME=`cygpath --windows "$JAVA_HOME"` JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
CLASSPATH=`cygpath --path --windows "$CLASSPATH"` CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
@ -161,7 +166,7 @@ fi
#ACTIVEMQ_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" #ACTIVEMQ_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
if [ -n "$CYGHOME" ]; then if [ -n "$CYGHOME" ]; then
exec "$JAVACMD" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS -Dactivemq.classpath="${ACTIVEMQ_CLASSPATH}" -Dactivemq.home="${ACTIVEMQ_HOME}" -Dactivemq.base="${ACTIVEMQ_BASE}" -Dactivemq.conf="${ACTIVEMQ_CONF}" -Dactivemq.data="${ACTIVEMQ_DATA}" -Dcygwin.user.home="$CYGHOME" -jar "${ACTIVEMQ_HOME}/bin/run.jar" $@ exec "$JAVACMD" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS -Dactivemq.classpath="${ACTIVEMQ_CLASSPATH}" -Dactivemq.home="${ACTIVEMQ_HOME}" -Dactivemq.base="${ACTIVEMQ_BASE}" -Dactivemq.conf="${ACTIVEMQ_CONF}" -Dactivemq.data="${ACTIVEMQ_DATA}" -Djava.io.tmpdir="${ACTIVEMQ_TMP}" -Dcygwin.user.home="$CYGHOME" -jar "${ACTIVEMQ_HOME}/bin/run.jar" $@
else else
exec "$JAVACMD" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS -Dactivemq.classpath="${ACTIVEMQ_CLASSPATH}" -Dactivemq.home="${ACTIVEMQ_HOME}" -Dactivemq.base="${ACTIVEMQ_BASE}" -Dactivemq.conf="${ACTIVEMQ_CONF}" -Dactivemq.data="${ACTIVEMQ_DATA}" -jar "${ACTIVEMQ_HOME}/bin/run.jar" $@ exec "$JAVACMD" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS -Dactivemq.classpath="${ACTIVEMQ_CLASSPATH}" -Dactivemq.home="${ACTIVEMQ_HOME}" -Dactivemq.base="${ACTIVEMQ_BASE}" -Dactivemq.conf="${ACTIVEMQ_CONF}" -Dactivemq.data="${ACTIVEMQ_DATA}" -Djava.io.tmpdir="${ACTIVEMQ_TMP}" -jar "${ACTIVEMQ_HOME}/bin/run.jar" $@
fi fi

View File

@ -75,6 +75,8 @@ if "%ACTIVEMQ_CONF%" == "" set ACTIVEMQ_CONF=%ACTIVEMQ_HOME%\conf
if "%ACTIVEMQ_DATA%" == "" set ACTIVEMQ_DATA=%ACTIVEMQ_HOME%\data if "%ACTIVEMQ_DATA%" == "" set ACTIVEMQ_DATA=%ACTIVEMQ_HOME%\data
if "%ACTIVEMQ_TMP%" == "" set ACTIVEMQ_TMP=%ACTIVEMQ_DATA%\tmp
if /i not "%1" == "start" goto debugOpts if /i not "%1" == "start" goto debugOpts
@ -93,7 +95,7 @@ REM SET ACTIVEMQ_DEBUG_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:tra
REM Setup ActiveMQ Classpath. Default is the conf directory. REM Setup ActiveMQ Classpath. Default is the conf directory.
set ACTIVEMQ_CLASSPATH=%ACTIVEMQ_CONF%;%ACTIVEMQ_DATA%;%ACTIVEMQ_CLASSPATH% set ACTIVEMQ_CLASSPATH=%ACTIVEMQ_CONF%;%ACTIVEMQ_DATA%;%ACTIVEMQ_CLASSPATH%
"%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% %SSL_OPTS% -Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" -Dactivemq.base="%ACTIVEMQ_BASE%" -Dactivemq.data="%ACTIVEMQ_DATA%" -Dactivemq.conf="%ACTIVEMQ_CONF%" -jar "%ACTIVEMQ_HOME%/bin/run.jar" %* "%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% %SSL_OPTS% -Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" -Dactivemq.base="%ACTIVEMQ_BASE%" -Dactivemq.data="%ACTIVEMQ_DATA%" -Djava.io.tmpdir="%ACTIVEMQ_TMP%" -Dactivemq.conf="%ACTIVEMQ_CONF%" -jar "%ACTIVEMQ_HOME%/bin/run.jar" %*
goto end goto end

View File

@ -75,6 +75,8 @@ if "%ACTIVEMQ_CONF%" == "" set ACTIVEMQ_CONF=%ACTIVEMQ_HOME%\conf
if "%ACTIVEMQ_DATA%" == "" set ACTIVEMQ_DATA=%ACTIVEMQ_HOME%\data if "%ACTIVEMQ_DATA%" == "" set ACTIVEMQ_DATA=%ACTIVEMQ_HOME%\data
if "%ACTIVEMQ_TMP%" == "" set ACTIVEMQ_TMP=%ACTIVEMQ_DATA%\tmp
if "%ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS=-Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties if "%ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS=-Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties
if "%SUNJMX%" == "" set SUNJMX=-Dcom.sun.management.jmxremote if "%SUNJMX%" == "" set SUNJMX=-Dcom.sun.management.jmxremote
@ -90,7 +92,7 @@ REM Setup ActiveMQ Classpath.
REM Add instance conf dir before AMQ install conf dir to pick up instance-specific classpath entries first REM Add instance conf dir before AMQ install conf dir to pick up instance-specific classpath entries first
set ACTIVEMQ_CLASSPATH=%ACTIVEMQ_CONF%;%ACTIVEMQ_BASE%/conf;%ACTIVEMQ_HOME%/conf;%ACTIVEMQ_CLASSPATH% set ACTIVEMQ_CLASSPATH=%ACTIVEMQ_CONF%;%ACTIVEMQ_BASE%/conf;%ACTIVEMQ_HOME%/conf;%ACTIVEMQ_CLASSPATH%
"%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% %SSL_OPTS% -Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" -Dactivemq.base="%ACTIVEMQ_BASE%" -Dactivemq.conf="%ACTIVEMQ_CONF%" -Dactivemq.data="%ACTIVEMQ_DATA%" -jar "%ACTIVEMQ_HOME%/bin/run.jar" start %* "%_JAVACMD%" %SUNJMX% %ACTIVEMQ_DEBUG_OPTS% %ACTIVEMQ_OPTS% %SSL_OPTS% -Dactivemq.classpath="%ACTIVEMQ_CLASSPATH%" -Dactivemq.home="%ACTIVEMQ_HOME%" -Dactivemq.base="%ACTIVEMQ_BASE%" -Dactivemq.conf="%ACTIVEMQ_CONF%" -Dactivemq.data="%ACTIVEMQ_DATA%" -Djava.io.tmpdir="%ACTIVEMQ_TMP%" -jar "%ACTIVEMQ_HOME%/bin/run.jar" start %*
goto end goto end