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

If ActiveMQ was started with low numer PID then activemq cli commands fails to check if ActiveMQ process is running.

    XMLWordPrintableJSON

Details

    • Important

    Description

      State of the world

      This commit introduced a new approach to check if the ActiveMQ process is running.

      The new approach lists all processes with `ps` command and then greps it:
      local RET="`ps -o "pid,args" | grep "^$activemq_pid\s.*java"`"

      Issue

      If ActiveMQ process was started with N digit PID and `ps` command returns processes with M digit PID (such that M > N) then `bin/activemq` script won't be able to identify if ActiveMQ is running. 

      Example

      $ ps -o "pid,args"
        PID COMMAND
         XX ActiveMQ java PROCESS
        XXX ANOTHER PROCESS 1
       XXXX ANOTHER PROCESS 2
      XXXXX ANOTHER PROCESS N
      

      In this example `ActiveMQ java PROCESS` is running with a two-digit PID `XX`.
      `ANOTHER PROCESS N` is running with a five-digit PID `XXXXX`.

      `ps` command will add additional spaces before the `ActiveMQ java PROCESS` to align it to the five-digit PID of `ANOTHER PROCESS N`.

      In this case the grep experssion `^$activemq_pid\s.*java` wont be able to identify the `ActiveMQ java PROCESS` with PID `XX`.

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            nevezhyn Roman Nieviezhyn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m