Home JBoss Server Run JBoss as Service HowTo
10 | 03 | 2010
JBoss 5 AS Book
"JBoss AS 5 development" reviews
Please share your feedback/review with other readers!
Banner
Dashboard
Advertise with Us
Banner
RSS Feed
Login
Sign here for the NewsLetter.



Poll
What book could be in your wish list next XMas ?
 
JBoss admin resources
Banner
JBoss howto

How can you solve deployment errors caused by large war/jar/ear files ?

jboss recipe of the day ...
Read More

How do you configure your .war to be deployed after your EJB ?

jboss recipe of the day ...
Read More

How do I configure a Queue/Topic to work in a cluster?

JBoss recipe of the day ...
Read More
Run JBoss as Service HowTo PDF Print E-mail
Written by F.Marchioni   
Tuesday, 15 December 2009 15:25

A short tutorial for JBoss administrator which illustrates how to start JBoss AS as Service both in Windows environment and in Unix-Linux environment.

start jboss as service howto
Windows users should use the service,bat shell command which is located into the JBOSS_HOME/bin folder. The service.bat commands needs at least one parameter to run:
 
C:\jboss-5.0.0.GA\bin>service
Usage: service install|uninstall|start|stop|restart|signal



In order to install JBoss AS as Windows service launch:

C:\jboss-5.0.0.GA\bin>service install





Now JBoss AS should me enlisted in the Windows Service List, which can be found in the control panel.
 
run jboss as service
Now you can use both the Windows service applet or the service.bat command to start the service. Example:

Starting JBoss AS service:

C:\jboss-5.0.0.GA\bin>service start





run jboss as serviceLinux applications use System V Init scripts to run an application when the machine boots.
Basically, the scripts which start a service are placed in:
/etc/rc.d/init.d/   (other distributions: /etc/init.d/)

The same scripts need to be linked as:
/etc/rc.(x)/  (Prefixed with S for start and K for stop)


We suggest you reading a good tutorial about Linux Init scripts if you are new to this:
http://www.linux.com/news/enterprise/systems-management/8116-an-introduction-to-services-runlevels-and-rcd-scripts

JBoss AS distribution includes a few shell commands which are located in the JBOSS_HOME/bin folder.

jboss_init_hpux.sh
jboss_init_redhat.sh
jboss_init_suse.sh

Copy the appropriate file for your distribution into the /etc/rc.d/init.d folder
 

cp jboss_init_redhat.sh /etc/rc.d/init.d/jboss
 




Now you should create a link for each System level so that Linux/Unix knows at which level the application server needs to be started:
 

ln -s /etc/rc.d/init.d/jboss /etc/rc3.d/S84jboss
ln -s /etc/rc.d/init.d/jboss /etc/rc5.d/S84jboss
ln -s /etc/rc.d/init.d/jboss /etc/rc4.d/S84jboss

ln -s /etc/rc.d/init.d/jboss /etc/rc6.d/K15jboss
ln -s /etc/rc.d/init.d/jboss /etc/rc0.d/K15jboss
ln -s /etc/rc.d/init.d/jboss /etc/rc1.d/K15jboss
ln -s /etc/rc.d/init.d/jboss /etc/rc2.d/K15jboss





We don't go deep into the details of Linux startup system but the links targeted as "S" are launched to start the service at a certain system level. The scripts marked with "K" are launched when the server is shuitting down.

As additional step you need to create a "log" folder in the JBOSS_HOME dir, where the service will send logging:  

mkdir $JBOSS_HOME/log

 

 


JBoss.org Search
Custom Search
Comments
Search
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Tuesday, 15 December 2009 17:04 )