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:59:01 UTC
[jira] [Commented] (AMQ-5842) activemq script doesn't work on
solaris because of "su" command
[ https://issues.apache.org/jira/browse/AMQ-5842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14585881#comment-14585881 ]
Thomas RICOU commented on AMQ-5842:
-----------------------------------
I am so sorry, i ran too fast into conclusion, the su command can still be used on Solaris bit not in that order :
su - $ACTIVEMQ_USER -c "..."
Man :
- su [-] [username [arg...]]
- Any additional arguments given on the command line are passed to the new shell. When using programs such as sh, an arg of the form -c string executes string using the shell and an arg of -r gives the user a restricted shell.
My apologies : I only checked -c is not un "man su" but I didn't read the "arg" explanation since I always use sudo -u $USER -c $CMD
My bad but I was not completely wrong.
> 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
> Labels: easyfix, script, solaris
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> 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)