You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/01/15 05:44:00 UTC

[jira] [Work logged] (AMQ-8425) Linux start script doesn't work depending of ps command version

     [ https://issues.apache.org/jira/browse/AMQ-8425?focusedWorklogId=709465&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-709465 ]

ASF GitHub Bot logged work on AMQ-8425:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Jan/22 05:43
            Start Date: 15/Jan/22 05:43
    Worklog Time Spent: 10m 
      Work Description: jbonofre merged pull request #739:
URL: https://github.com/apache/activemq/pull/739


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 709465)
    Remaining Estimate: 0h
            Time Spent: 10m

> Linux start script doesn't work depending of ps command version
> ---------------------------------------------------------------
>
>                 Key: AMQ-8425
>                 URL: https://issues.apache.org/jira/browse/AMQ-8425
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.16.3
>            Reporter: Jean-Baptiste Onofré
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 5.17.0, 5.16.4
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)