From 0eb45b434d943e274b8a8dabc1e9b9247f18a1bb Mon Sep 17 00:00:00 2001 From: Marc Schoechlin Date: Sun, 4 Jan 2015 12:44:07 +0100 Subject: [PATCH] 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. --- assembly/src/release/bin/activemq | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assembly/src/release/bin/activemq b/assembly/src/release/bin/activemq index b4d2c879bc..d746cd378f 100755 --- a/assembly/src/release/bin/activemq +++ b/assembly/src/release/bin/activemq @@ -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