I will describe my way to install the JBoss server on Gentoo. My knowledge of UNIX is average, term which would describe me relations with Linux is “Coitus interruptus”. Gentoo proved to be a little more demanding than other distributions.

Steps that we need to do:
- Using WinSCP, we copy JBoss zip to the server to “/usr/local/” location.
- We perform following set of actions: install zip, unpacks zip which contains the JBoss AS in the “/usr/local/ jboss “, creat user “jboss”, gives ownership of the directory that contains the server to the created user.
emerge zip
cd /usr/local/
unzip jboss-4.2.3.GA.zip
useradd -d /usr/local/jboss -s /bin/sh jboss
chown jboss jboss-4.2.3.GA - We run the server in background (nohup), to be sure that server is running after closeing the console. Apart from this we want to write down the logs in this directory (/root/logs).
nohup /usr/local/jboss/bin/run.sh > /root/logs/log.txt 2 > /root/logs/error.txt < /dev/null & - It is good to run "ps -A", to check if the proccess is running in the background.
- If we can find "run.sh" and "java", we can cosider the installation done.
Running mysql database and JBoss AS during Gentoo startup
According to JBoss installation instructions (for UNIX), it is good if the server is started as a 'jboss' user. Unfortunately I could not do that. Manual also suggests the creation of jboss services which should be added to init.d. Sadly, the files supplied with the server on Gentoo fail to do anything because this theoretical “correct” way was useless; I decided to try another approach, which was successful. As a side effect it also starts mysql database.
- I added two lines to this file: "/etc/conf.d/local.start". Final content of this file, looks as follows:
# /etc/conf.d/local.start
# This is a good place to load any misc programs
# on startup (use &>/dev/null to hide output)
/etc/init.d/mysql start
nohup /usr/local/jboss/bin/run.sh > /root/logs/log.txt 2 > /root/logs/error.txt < /dev/null & - Ready
While trying various ways, I found folowing commands useful:
- killall -r java -s 9 - kills all java procceses (-s 9 means "no mercy" :))
- ps -A|grep java - if there are no other applications based on java, this command will shows us if the server is running.
There are several more things that need to be done.
A cyclic routine has to check from time to time, whether the server is still running. I know that 'cron' might be usefull. I will describe my findings if I manage to do it.
If this solution is bad or you can solve some things better, please let us know ASAP and we will introduce amendments.




