You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Dhanasekar (Jira)" <ji...@apache.org> on 2022/01/10 10:30:00 UTC
[jira] [Commented] (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?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17471848#comment-17471848 ]
Dhanasekar commented on AMQ-8226:
---------------------------------
looks like this enhancement root cause for the issue reported in https://issues.apache.org/jira/browse/AMQ-8383
> 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
> Reporter: Roman Nieviezhyn
> Assignee: Jean-Baptiste Onofré
> Priority: Major
> Fix For: 5.17.0, 5.15.15, 5.16.2
>
> Time Spent: 20m
> 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.20.1#820001)