[jboss-rpm] Using RPM packaged JBoss AS in different location by different user

Marek Goldmann mgoldman at redhat.com
Fri Apr 13 11:51:53 EDT 2012


Hi All,

With the upcoming jboss-as-7.1.0-3 the usage outside of 
/usr/share/jboss-as directory and by different user to jboss-as was 
simplified. Below you can find steps how you'll be able to use it.

Let's go with an example. I'm assuming you have a user called "tom".

1. Create required directory structure

# Let's go to his home directory
cd /home/tom
# Create the root directory where we want to store
# JBoss AS configuration and temporary data
mkdir jboss-as
cd jboss-as
# Create required direcotries
mkdir data deployments log tmp configuration

2. Copy required configuration files (feel free to use your own!)

# Let's copy the logging.properties
cp /usr/share/jboss-as/standalone/configuration/logging.properties 
configuration/
# Let's copy the mgmt-users.properties
cp /usr/share/jboss-as/standalone/configuration/mgmt-users.properties 
configuration/
# Copy standalone.xml
cp /usr/share/jboss-as/standalone/configuration/standalone-web.xml 
configuration/

3. Boot the server! (yep, that's all)

JBOSS_BASE_DIR=/home/tom/jboss-as /usr/share/jboss-as/bin/standalone.sh 
-c standalone-web.xml



But if you want to run a JBoss AS service by different user using 
different configuration (hi oVirt guys!) then you need to create two 
additional files:

/home/tom/jboss-as.conf:

===============
JBOSS_PIDFILE=/home/tom/jboss-as.pid
JBOSS_BASE_DIR=/home/tom/jboss-as
JBOSS_CONFIG=standalone-web.xml
===============

/usr/lib/systemd/system/tom.service:

===============
[Unit]
Description=Tom's JBoss Application Server
After=syslog.target network.target

[Service]
Environment=LAUNCH_JBOSS_IN_BACKGROUND=1
EnvironmentFile=-/home/tom/jboss-as.conf
User=tom
LimitNOFILE=102642
PIDFile=/home/tom/jboss-as.pid
ExecStart=/usr/share/jboss-as/bin/standalone.sh -c $JBOSS_CONFIG
StandardOutput=null

[Install]
WantedBy=multi-user.target
===============

Of course feel free to tweak these files.

Remember, everything you see above will work after 7.1.0-3 gets released.

Opinions?

--Marek


More information about the jboss-rpm mailing list