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 2021/04/15 23:15:00 UTC

[jira] [Work logged] (AMQ-8226) If ActiveMQ was started with low numer PID then activemq cli commands fails to check if ActiveMQ process is running.

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

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

                Author: ASF GitHub Bot
            Created on: 15/Apr/21 23:14
            Start Date: 15/Apr/21 23:14
    Worklog Time Spent: 10m 
      Work Description: Charlie-chenchrl opened a new pull request #648:
URL: https://github.com/apache/activemq/pull/648


   …mq startup script
   
   ### Description
   - fix for [AMQ-8226](https://issues.apache.org/jira/browse/AMQ-8226). 
   - added `\s*` before `$activemq_pid` to match any amount of spaces in `ps -o` command


-- 
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.

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


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

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

> If ActiveMQ was started with low numer PID then activemq cli commands fails to check if ActiveMQ process is running.
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-8226
>                 URL: https://issues.apache.org/jira/browse/AMQ-8226
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Command Line Tools
>    Affects Versions: 5.15.15
>            Reporter: Roman Nieviezhyn
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> h3. State of the world
> [This|https://github.com/apache/activemq/commit/1cb94f5e48b9265bd78ec01595d7f4d747d7c8e8] commit introduced a new approach to check if the ActiveMQ process is running.
> [The new approach|https://github.com/apache/activemq/commit/1cb94f5e48b9265bd78ec01595d7f4d747d7c8e8#diff-5306708c9411eee811fbf2bbb46578ed8d34abc2e7313d7e2c4d8db12b48b0f3R390] lists all processes with `ps` command and then greps it:
>  local RET="`ps -o "pid,args" | grep "^$activemq_pid\s.*java"`"
> h3. 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. 
> h3. Example
> {noformat}
> $ ps -o "pid,args"
>   PID COMMAND
>    XX ActiveMQ java PROCESS
>   XXX ANOTHER PROCESS 1
>  XXXX ANOTHER PROCESS 2
> XXXXX ANOTHER PROCESS N
> {noformat}
> 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`.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)