开发者

jbooss with RUNASIS option

I am starting the jboss_3.2.7 with the linux user jbs using jboss with RUNASIS option, but it is not working while the entire system[linux] restart. Which is starting the jboss as ro开发者_JAVA百科ot user.

I added the jboss service in chkconfig option of linux for starting the jboss on linux restart.


In the jboss service file (/etc/init.d) modified the user to RUNASIS
define the user under which jboss will run, or use RUNASIS to run as the current user

JBOSSUS=${JBOSSUS:-"RUNASIS"}


You are using quite old JBoss version and I personally never see it. But I think it should be very similar to newer ones.

Please try to put your user after when defining these variable:

JBOSSUS=jbs

The other solution is to setting these variable before executing running script:

export JBOSSUS=jbs; /etc/init.d/jboss start

Update

I have just downloaded JBoss 3.2.7 and I checked the jboss_init_redhat.sh script (I hope you use these one as a templete for your starting script).

In the file jboss_init_redhat.sh you can find such lines:

#define the user under which jboss will run, or use RUNASIS 
#to run as the current user
JBOSSUS=${JBOSSUS:-"jboss"}

These line defines the new user name. It checks if the variable JBOSSUS is set up and if not is uses jboss user as default name.

The second interesting part of these script:

if [ "$JBOSSUS" = "RUNASIS" ]; then
  SUBIT=""
else
  SUBIT="su - $JBOSSUS -c "
fi

You should know one thing: when you run automatically any script from init scripts it is always run as a root user. Thats why in the script should be command which change the effective user to someone else. And here you have these part of the script.

It first checked if your username is RUNASIS and if it is yes - do nothing. In another case it run JBoss as a another user by using su command.

In your case it should be sufficient to change JBOSSUS variable definition to something like that:

JBOSSUS=jbs

After that you can start these script as a root user and it should run JVM with JBoss with jbs user.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜