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

Linux start script doesn't work depending of ps command version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.16.3
    • 5.16.4, 5.17.0
    • Broker
    • None

    Description

      bin/activemq, line 485 reads:

      local RET="`ps -o "pid,args" | grep "^\s*$activemq_pid\s.*java"`"

      The problem is (from ps man page):

      "By default, ps selects all processes with the same effective user
      ID (euid=EUID) as the current user and associated with the same
      terminal as the invoker."

      Thus, the script essentially will ONLY find a running process
      that has been started by the SAME LOGIN-SESSION.

      I would say, that is rarely (if ever) the case in real-world scenarios.

      For example, you login to your app-server and start ActiveMQ, then logout.
      At a later point, you login again (new session) and try to stop ActiveMQ.
      But unexpectedly, nothing happens

      The fix was simple, in the line above, add the '-e' flag:

      local RET="`ps -eo "pid,args" | grep "^\s*$activemq_pid\s.*java"`"

      ps -e means it will list ALL processes on the host.
      Then it works as expected.

      Attachments

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              jbonofre Jean-Baptiste Onofré
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 10m
                  10m