[
https://issues.apache.org/jira/browse/ARTEMIS-4630?focusedWorklogId=903432&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-903432
]
ASF GitHub Bot logged work on ARTEMIS-4630:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 02/Feb/24 21:09
Start Date: 02/Feb/24 21:09
Worklog Time Spent: 10m
Work Description: jbertram commented on code in PR #4801:
URL: https://github.com/apache/activemq-artemis/pull/4801#discussion_r1476733634
##########
artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/bin/artemis-service:
##########
@@ -61,7 +61,7 @@ status() {
pid=`cat "${PID_FILE}"`
# check to see if it's gone...
ps -p ${pid} > /dev/null
- if [ $? -eq 0 ] ; then
+ if [ $? -eq 0 ] && [ `pwdx ${pid} | awk '{print $2}'` ==
"$ARTEMIS_INSTANCE" ]; then
Review Comment:
I couldn't get this to work in my testing. I kept getting this:
```
./artemis-service: 64: [: /home/jbertram: unexpected operator
```
However, this worked:
```
if [ $? -eq 0 ] && [ "`pwdx ${pid} | awk '{print $2}'`" =
"$ARTEMIS_INSTANCE" ] ; then
```
Issue Time Tracking
-------------------
Worklog Id: (was: 903432)
Time Spent: 0.5h (was: 20m)
> AMQ Service status is not validating if the pid is from Artemis
> ---------------------------------------------------------------
>
> Key: ARTEMIS-4630
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4630
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 2.32.0
> Reporter: Angelo Galvão
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> In a rare condition, an old artemis.pid file is pointing to an existing
> process that is not Artemis, causing the provisioning tools to believe that
> Artemis process is running.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)