Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-3936

activemq status return codes should be LSB compliant

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 5.6.0
    • 5.7.0
    • None
    • None

    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

      Attachments

        Activity

          People

            Unassigned Unassigned
            benmathews Ben Mathews
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: