Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
5.6.0
-
None
-
None
-
[root@esb1 ~]# uname -a
Linux esb1 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@esb1 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.0 (Santiago)Active MQ was installed with an rpm built using https://github.com/shdwjk/apache-activemq
[root@esb1 ~] # uname -a Linux esb1 2.6.32-71.el6.x86_64 #1 SMP Wed Sep 1 01:33:01 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux [root@esb1 ~] # cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.0 (Santiago) Active MQ was installed with an rpm built using https://github.com/shdwjk/apache-activemq
Description
The activemq status command should return error codes matching the status. (See http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html)
The file I tested in the download is apache-activemq-5.6.0/bin/linux-x86-64/activemq. There is code in it that appears to return 1 on a stopped state
status() {
getpid
if [ "X$pid" = "X" ]
then
echo "$APP_LONG_NAME is not running."
exit 1
else
echo "$APP_LONG_NAME is running ($pid)."
exit 0
fi
}
However, a 0 is always returned. Running with a -x shows that some other commands are getting run which results in a 0 return value.
+ IDEXE=/usr/bin/id
+ '[' '!' -x /usr/bin/id ']'
++ /usr/bin/id -u -n
+ '[' root = activemq ']'
+ '[' Xactivemq '!=' X ']'
+ '[' Xwrapper.lockfile=/var/lock/subsys/ActiveMQ '!=' X ']'
+ '[' X '!=' X ']'
+ su -m activemq -c '/etc/rc.d/init.d/activemq status'
ActiveMQ Broker is not running.
+ '[' Xwrapper.lockfile=/var/lock/subsys/ActiveMQ '!=' X ']'
+ getpid
+ '[' -f /var/run/activemq//ActiveMQ.pid ']'
+ '[' X = X ']'
+ '[' -f /var/lock/subsys/ActiveMQ ']'
+ exit 0