[ 
https://issues.apache.org/jira/browse/AMQ-6190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ben Magistro updated AMQ-6190:
------------------------------
    Attachment: activemq.patch

Attached is what  I think might be a reasonable patch to this.  This doesn't 
change who owns the pid file (did not test the scenario where the pid exists 
and is not readable by the user calling console or where console has been 
started but pid is not readable by the user calling start).  It is probably 
simpler to not change ownership as it should ensure the user who called console 
and created the pid can also remove it.

1) Updates the output of console to include the pid of the running process 
(copied directly from invoke_start)
2) Do not call exec when invoking jar.  As I understand it, exec replaces the 
process but we want to come back and clean up when we are done
3) Exit if we cannot create the pid file, this may mean there is already 
another copy running somewhere
4) Add a hook on the interrupt signal (might make sense to add a few others) 
but only when this routine is called (minimally tested while calling bstat)
5) Create interrupt handler function to finish cleaning up

> When running "./bin/activemq console" PID file is not owned by "ACTIVEMQ_USER"
> ------------------------------------------------------------------------------
>
>                 Key: AMQ-6190
>                 URL: https://issues.apache.org/jira/browse/AMQ-6190
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.13.0
>         Environment: CentOS 6.x
>            Reporter: Ben Magistro
>            Priority: Minor
>              Labels: easyfix
>         Attachments: activemq.patch
>
>
> When "ACTIVEMQ_USER" is defined and launching via "./bin/activemq start" PID 
> file is owned by the defined user.  If launching as "./bin/activemq console" 
> PID file is owned by the calling user.  Subsequent calls to "start" may fail 
> as permissions would not allow the defined user to manipulate the file.
> Workarounds:
> 1) call console using "sudo -u <defined user> ./bin/activemq console" (or 
> switch to the user if it is allowed (user may not be allowed to login)
> 2) change ownership of pid file
> 3) remove pid file
> Suggest either creating the pid file using the defined user and/or removing 
> the pid file once ctrl+c has been pressed/console run ends.
> Edit:
> Looking at the script there is a print line to say it is removing thepid file 
> but the command to do the work is no present.  Using others in the script as 
> a reference, at line 481 insert "rm -f "$ACTIVEMQ_PIDFILE" >/dev/null 2>&1"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to