mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3645 - shell script improvements
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1222650 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
384388fe62
commit
46e6cc01fc
|
@ -90,15 +90,36 @@ if [ -z "$ACTIVEMQ_BASE" ] ; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Active MQ configuration directory
|
# Active MQ configuration directory
|
||||||
ACTIVEMQ_CONFIG_DIR="$ACTIVEMQ_BASE/conf"
|
if [ -z "$ACTIVEMQ_CONFIG_DIR" ] ; then
|
||||||
|
ACTIVEMQ_CONFIG_DIR="$ACTIVEMQ_BASE/conf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Configure a user with non root priviledges, if no user is specified do not change user
|
||||||
|
if [ -z "$ACTIVEMQ_USER" ] ; then
|
||||||
|
ACTIVEMQ_USER=""
|
||||||
|
fi
|
||||||
|
|
||||||
# Active MQ configuration directory
|
# Active MQ configuration directory
|
||||||
if [ -z "$ACTIVEMQ_DATA_DIR" ]; then
|
if [ -z "$ACTIVEMQ_DATA_DIR" ]; then
|
||||||
ACTIVEMQ_DATA_DIR="$ACTIVEMQ_BASE/data"
|
ACTIVEMQ_DATA_DIR="$ACTIVEMQ_BASE/data"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
setCurrentUser(){
|
||||||
|
CUSER=`whoami 2>/dev/null`
|
||||||
|
|
||||||
|
# Solaris fix
|
||||||
|
if [ ! $? -eq 0 ]; then
|
||||||
|
CUSER=`/usr/ucb/whoami 2>/dev/null`
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! -d "$ACTIVEMQ_DATA_DIR" ]; then
|
if [ ! -d "$ACTIVEMQ_DATA_DIR" ]; then
|
||||||
mkdir $ACTIVEMQ_DATA_DIR
|
setCurrentUser
|
||||||
|
if ( [ -z "$ACTIVEMQ_USER" ] || [ "$ACTIVEMQ_USER" = "$CUSER" ] );then
|
||||||
|
mkdir $ACTIVEMQ_DATA_DIR
|
||||||
|
elif [ "`id -u`" = "0" ];then
|
||||||
|
su -c "mkdir $ACTIVEMQ_DATA_DIR" - $ACTIVEMQ_USER;
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Location of the pidfile
|
# Location of the pidfile
|
||||||
|
@ -113,9 +134,6 @@ fi
|
||||||
#JAVA_HOME=""
|
#JAVA_HOME=""
|
||||||
JAVACMD="auto"
|
JAVACMD="auto"
|
||||||
|
|
||||||
# Configure a user with non root priviledges, if no user is specified do not change user
|
|
||||||
ACTIVEMQ_USER=""
|
|
||||||
|
|
||||||
# Set jvm memory configuration
|
# Set jvm memory configuration
|
||||||
if [ -z "$ACTIVEMQ_OPTS_MEMORY" ] ; then
|
if [ -z "$ACTIVEMQ_OPTS_MEMORY" ] ; then
|
||||||
ACTIVEMQ_OPTS_MEMORY="-Xms256M -Xmx1G"
|
ACTIVEMQ_OPTS_MEMORY="-Xms256M -Xmx1G"
|
||||||
|
@ -161,7 +179,9 @@ ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
|
||||||
ACTIVEMQ_SUNJMX_CONTROL=""
|
ACTIVEMQ_SUNJMX_CONTROL=""
|
||||||
|
|
||||||
# Specify the queue manager URL for using "browse" option of sysv initscript
|
# Specify the queue manager URL for using "browse" option of sysv initscript
|
||||||
ACTIVEMQ_QUEUEMANAGERURL="--amqurl tcp://localhost:61616"
|
if [ -z "$ACTIVEMQ_QUEUEMANAGERURL" ]; then
|
||||||
|
ACTIVEMQ_QUEUEMANAGERURL="--amqurl tcp://localhost:61616"
|
||||||
|
fi
|
||||||
|
|
||||||
# Set additional JSE arguments
|
# Set additional JSE arguments
|
||||||
ACTIVEMQ_SSL_OPTS="$SSL_OPTS"
|
ACTIVEMQ_SSL_OPTS="$SSL_OPTS"
|
||||||
|
@ -174,7 +194,9 @@ ACTIVEMQ_SSL_OPTS="$SSL_OPTS"
|
||||||
|
|
||||||
# ActiveMQ tries to shutdown the broker by jmx,
|
# ActiveMQ tries to shutdown the broker by jmx,
|
||||||
# after a specified number of seconds send SIGKILL
|
# after a specified number of seconds send SIGKILL
|
||||||
ACTIVEMQ_KILL_MAXSECONDS=30
|
if [ -z "$ACTIVEMQ_KILL_MAXSECONDS" ]; then
|
||||||
|
ACTIVEMQ_KILL_MAXSECONDS=30
|
||||||
|
fi
|
||||||
|
|
||||||
## END:DEFAULTCONFIG
|
## END:DEFAULTCONFIG
|
||||||
|
|
||||||
|
@ -322,21 +344,6 @@ if [ "${ACTIVEMQ_BASE}" != "${ACTIVEMQ_HOME}" ]; then
|
||||||
ACTIVEMQ_CLASSPATH="${ACTIVEMQ_BASE}/conf;${ACTIVEMQ_CLASSPATH}"
|
ACTIVEMQ_CLASSPATH="${ACTIVEMQ_BASE}/conf;${ACTIVEMQ_CLASSPATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------
|
|
||||||
# HELPER FUNCTIONS
|
|
||||||
|
|
||||||
|
|
||||||
setCurrentUser(){
|
|
||||||
CUSER=`whoami 2>/dev/null`
|
|
||||||
|
|
||||||
# Solaris fix
|
|
||||||
if [ ! $? -eq 0 ]; then
|
|
||||||
CUSER=`/usr/ucb/whoami 2>/dev/null`
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Start the ActiveMQ JAR
|
# Start the ActiveMQ JAR
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue