mirror of https://github.com/apache/activemq.git
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:
parent
b5e294372f
commit
a7873fc8ce
|
@ -53,6 +53,13 @@ public class Main {
|
|||
private Set<File> activeMQClassPath = new HashSet<File>(5);
|
||||
|
||||
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();
|
||||
|
||||
// Convert arguments to collection for easier management
|
||||
|
|
|
@ -6,4 +6,4 @@ public class LowercasingPasswordFactory implements PasswordFactory {
|
|||
return password.toLowerCase();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -104,6 +104,10 @@ if [ -z "$ACTIVEMQ_DATA" ] ; then
|
|||
ACTIVEMQ_DATA="$ACTIVEMQ_BASE/data"
|
||||
fi
|
||||
|
||||
if [ -z "$ACTIVEMQ_TMP" ] ; then
|
||||
ACTIVEMQ_TMP="$ACTIVEMQ_BASE/tmp"
|
||||
fi
|
||||
|
||||
setCurrentUser(){
|
||||
CUSER=`whoami 2>/dev/null`
|
||||
|
||||
|
@ -334,6 +338,7 @@ if [ "$OSTYPE" = "cygwin" ];then
|
|||
JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
CYGHOME=`cygpath --windows "$HOME"`
|
||||
ACTIVEMQ_TMP=`cygpath --windows "$ACTIVEMQ_TMP"`
|
||||
if [ -n "$CYGHOME" ]; then
|
||||
ACTIVEMQ_CYGWIN="-Dcygwin.user.home=\"$CYGHOME\""
|
||||
fi
|
||||
|
@ -382,6 +387,7 @@ invokeJar(){
|
|||
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
|
||||
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
|
||||
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
|
||||
-Djava.io.tmpdir=\"${ACTIVEMQ_TMP}\" \
|
||||
$ACTIVEMQ_CYGWIN \
|
||||
-jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS >/dev/null 2>&1 &
|
||||
RET=\"\$?\"; APID=\"\$!\";
|
||||
|
@ -396,6 +402,7 @@ invokeJar(){
|
|||
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
|
||||
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
|
||||
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
|
||||
-Djava.io.tmpdir=\"${ACTIVEMQ_TMP}\" \
|
||||
$ACTIVEMQ_CYGWIN \
|
||||
-jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS --pid $PID &
|
||||
RET=\"\$?\"; APID=\"\$!\";
|
||||
|
@ -408,6 +415,7 @@ invokeJar(){
|
|||
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
|
||||
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
|
||||
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
|
||||
-Djava.io.tmpdir=\"${ACTIVEMQ_TMP}\" \
|
||||
$ACTIVEMQ_CYGWIN \
|
||||
-jar \"${ACTIVEMQ_HOME}/bin/run.jar\" $COMMANDLINE_ARGS" $DOIT_POSTFIX
|
||||
RET="$?"
|
||||
|
|
|
@ -116,6 +116,10 @@ if [ -z "$ACTIVEMQ_BASE" ] ; then
|
|||
ACTIVEMQ_BASE="$ACTIVEMQ_HOME"
|
||||
fi
|
||||
|
||||
if [ -z "$ACTIVEMQ_TMP" ] ; then
|
||||
ACTIVEMQ_TMP="$ACTIVEMQ_BASE/tmp"
|
||||
fi
|
||||
|
||||
# Active MQ configuration directory
|
||||
if [ -z "$ACTIVEMQ_CONF" ] ; then
|
||||
ACTIVEMQ_CONF="$ACTIVEMQ_BASE/conf"
|
||||
|
@ -132,6 +136,7 @@ if $cygwin; then
|
|||
ACTIVEMQ_BASE=`cygpath --windows "$ACTIVEMQ_BASE"`
|
||||
ACTIVEMQ_CONF=`cygpath --windows "$ACTIVEMQ_CONF"`
|
||||
ACTIVEMQ_DATA=`cygpath --windows "$ACTIVEMQ_DATA"`
|
||||
ACTIVEMQ_TMP=`cygpath --windows "$ACTIVEMQ_TMP"`
|
||||
ACTIVEMQ_CLASSPATH=`cygpath --path --windows "$ACTIVEMQ_CLASSPATH"`
|
||||
JAVA_HOME=`cygpath --windows "$JAVA_HOME"`
|
||||
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"
|
||||
|
||||
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
|
||||
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
|
||||
|
|
|
@ -75,6 +75,8 @@ if "%ACTIVEMQ_CONF%" == "" set ACTIVEMQ_CONF=%ACTIVEMQ_HOME%\conf
|
|||
|
||||
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
|
||||
|
||||
|
||||
|
@ -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.
|
||||
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
|
||||
|
||||
|
|
|
@ -75,6 +75,8 @@ if "%ACTIVEMQ_CONF%" == "" set ACTIVEMQ_CONF=%ACTIVEMQ_HOME%\conf
|
|||
|
||||
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 "%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
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue