activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Schöchlin (JIRA) <>
Subject [jira] [Commented] (AMQ-2920) new ActiveMQ 5.4.0 sysv start script redirects process stdout and stderr to /dev/null
Date Tue, 10 Sep 2013 14:21:02 GMT


Marc Schöchlin commented on AMQ-2920:

I fully agree, this might be a real pain for debugging production problems.
Threaddumps can also be collected 

I suppressed all messages on STDOUT/STDERR in the implementation of the new init script because
this logfile cannot be rotated by log4j.

I think it would be really useful to redirect STDOUT/STDERR to the activemq logfile.
As i can remember JBOSS also does this, probably the sourcecode might be useful for changing
Probably a redirected logger fails i.e in situations with memory problems - i don't know how
jboss handles these types of problems.

Alternative way: 
 * Reconfigure log4j not to log regular log messages to STDOUT/STDERR
   (this logfile is not rotated, therefore only really essential/critical things should be
logged in this file)
 * Modify sys-v init script to provide the possibility to log messages to a logfile specified
in /etc/default/activemq or $HOME/.activemqrc
   (see appended patch)

$ LANG=C diff -u activemq.orig activemq
--- activemq.orig	2013-09-10 16:02:36.221780777 +0200
+++ activemq	2013-09-10 16:13:38.813794912 +0200
@@ -214,6 +214,10 @@
+# LOG STDERR/STDOUT to this file 
+# (be careful, because this logfile is not under logrotation)
 # ------------------------------------------------------------------------
@@ -393,6 +397,8 @@
    # Execute java binary
    if [ -n "$PIDFILE" ] && [ "$PIDFILE" != "stop" ];then
+      echo "INFO: redirecting activemq stderr/stdout to $ACTIVEMQ_CONSOLE_LOG"
               -Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
               -Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
@@ -400,7 +406,7 @@
               -Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
     \"${ACTIVEMQ_DATA}\" \
               $ACTIVEMQ_CYGWIN \
-              -jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS >/dev/null
2>&1 &
+              -jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS >$ACTIVEMQ_CONSOLE_LOG
2>&1 &
               RET=\"\$?\"; APID=\"\$!\";
               echo \$APID > $PIDFILE;
               echo \"INFO: pidfile created : '$PIDFILE' (pid '\$APID')\";exit \$RET" $DOIT_POSTFIX
@@ -691,4 +697,4 @@
\ No newline at end of file

> new ActiveMQ 5.4.0 sysv start script redirects process stdout and stderr to /dev/null
> -------------------------------------------------------------------------------------
>                 Key: AMQ-2920
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.4.0
>            Reporter: Mats Henrikson
>            Assignee: Gary Tully
>             Fix For: 5.6.0
> It appears that the new sysV start/init script redirects all the process output to /dev/null
when starting the broker.
> This leads to pain and confusion, since you will not see any error output when you have
e.g. a non-compliant activemq.xml config file - the script just completes successfully but
your broker has not started. To see the output you actually have to hack the init script to
remove the /dev/null, or get the script to output the command line so that you can run it
by hand to get the error output.
> The process output should probably be redirected to some log file in the data directory.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message