[mule-user] mule startup script with RUN_AS_USER and config xml

1 view
Skip to first unread message

iwa...@nttdata.co.jp

unread,
Sep 10, 2009, 7:02:48 AM9/10/09
to us...@mule.codehaus.org
Hello list,

Using Mule 2.2.1 CE on CentOS 5.3.

I am now using a modified version of $MULE_HOME/bin/mule
script, in which I set RUN_AS_USER variable to a non-root user
and it is working great (because of help I got from this list, thanks!).

One thing I noticed is that with this modified script, I am no longer
able to specify which config.xml to use on the command line:

# $MULE_HOME/bin/mule_run_as_version start -config my.xml

mule ignores my.xml and resorts to the default mule-config.xml.

Does this happen only to me because I made some mistake when
editing? Or is this a bug in the original script? If so, how do I fix
this?

Thanks in advance.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Yuji YAMANO

unread,
Sep 10, 2009, 10:27:47 PM9/10/09
to us...@mule.codehaus.org, iwa...@nttdata.co.jp
On Thu, 10 Sep 2009 20:02:48 +0900, <iwa...@nttdata.co.jp> wrote:

> I am now using a modified version of $MULE_HOME/bin/mule
> script, in which I set RUN_AS_USER variable to a non-root user
> and it is working great (because of help I got from this list, thanks!).
>
> One thing I noticed is that with this modified script, I am no longer
> able to specify which config.xml to use on the command line:

Seems to be a bug. Could you try the following patch?
I don't test it by myself.

--- mule.orig 2008-07-06 23:03:20.000000000 -0700
+++ mule 2009-09-10 19:17:31.671875000 -0700
@@ -398,7 +398,8 @@

# Still want to change users, recurse. This means that the user will only be
# prompted for a password once. Variables shifted by 1
- su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
+ ARGS=`echo $* | sed -e 's/^[^[:blank:]]*[[:blank:]]*//'`
+ su -m $RUN_AS_USER -c "\"$REALPATH\" $ARGS"

# Now that we are the original user again, we may need to clean up the lock file.
if [ "X$LOCKPROP" != "X" ]
@@ -613,35 +614,35 @@
case "$1" in

'console')
- checkUser touchlock $1
+ checkUser touchlock $*
checkAdditionalJvmParams $*
console
;;

'start')
- checkUser touchlock $1
+ checkUser touchlock $*
checkAdditionalJvmParams $*
start
;;

'stop')
- checkUser "" $1
+ checkUser "" $*
stopit
;;

'restart')
- checkUser touchlock $1
+ checkUser touchlock $*
stopit
start
;;

'status')
- checkUser "" $1
+ checkUser "" $*
status
;;

'dump')
- checkUser "" $1
+ checkUser "" $*
dump
;;

--
Yuji Yamano
OGIS International, Inc.

Yuji YAMANO

unread,
Sep 15, 2009, 1:51:15 PM9/15/09
to us...@mule.codehaus.org, iwa...@nttdata.co.jp
Could you raise the issue to JIRA if the patch fixes it?
Reply all
Reply to author
Forward
0 new messages