create a pidfile for a console run

this adds a pidfile which contains the pid of the running shellscript if
activemq is run by "console". This prevents problems if someone tries to
to use i.e. the start/stop options while some is debugging activemq in
foreground mode.
This commit is contained in:
Marc Schoechlin 2015-01-04 12:44:07 +01:00
parent 02a94143db
commit 0eb45b434d
1 changed files with 5 additions and 1 deletions

View File

@ -449,8 +449,12 @@ invoke_console(){
COMMANDLINE_ARGS="start `echo $COMMANDLINE_ARGS|sed 's,^console,,'`"
EXEC_OPTION="exec"
echo "INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C)"
echo "INFO: Creating pidfile $ACTIVEMQ_PIDFILE"
echo "$$" > $ACTIVEMQ_PIDFILE
invokeJar
exit "$?"
RET="$?"
echo "INFO: removing pidfile $ACTIVEMQ_PIDFILE"
exit "$RET"
}
# Stop ActiveMQ