You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Thomas RICOU (JIRA)" <ji...@apache.org> on 2015/06/15 14:34:00 UTC

[jira] [Created] (AMQ-5842) activemq script doesn't work on solaris because of "su" command

Thomas RICOU created AMQ-5842:
---------------------------------

             Summary: activemq script doesn't work on solaris because of "su" command
                 Key: AMQ-5842
                 URL: https://issues.apache.org/jira/browse/AMQ-5842
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.11.1
         Environment: Solaris 11.1 (SPARC)
Activemq 5.11.1 installed from tar.gz
            Reporter: Thomas RICOU
            Priority: Trivial


I installed activemq from archive and wished to run the broker using a specific user but I was having a problem with the "su" command lines 134 : su -c "mkdir $ACTIVEMQ_DATA" - $ACTIVEMQ_USER; and 294/295 : su -s /bin/sh -c "..." - $ACTIVEMQ_USER

Actually, the "su" command is used to "Switch User" whereas the intended task here is to execute a commad as another user. In my opinion, the "need" and the "command goal" don't match. Moreover, the "sudo" command matches better : Switch User DO. And on my platform, the "su" command doesn't support the -c parameter and only permits to change the current user before typing other commands.

So I would use the "sudo" command like that : 
- line 134 : sudo -u $ACTIVEMQ_USER mkdir $ACTIVEMQ_DATA
- line 294 : DOIT_PREFIX="sudo -u $ACTIVEMQ_USER /bin/sh -c "
And I would also remove the DOIT_POSTFIX variable :
- to leave the 295th line empty
- to adjust lines 310, 323 and 333 without $DOIT_POSTFIX




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