Link to home
Start Free TrialLog in
Avatar of srujanmiryala
srujanmiryalaFlag for India

asked on

Jboss Production server start up script

Hi,
      For the first time i have been working on jboss, production server and deployements of applications and i am using jboss-5.1.0 as my production server. I have multiple instances of jboss(default,default1,default2). Now if i want to run these instances i need to use the following commands

./run.sh –c default  –b 0.0.0.0
./run.sh –c default1 –b 0.0.0.0
./run.sh –c default2 –b 0.0.0.0

Instead of these can i have a single script file to execute these three commands. If so please help me out with the script
Avatar of Dushyant Sharma
Dushyant Sharma
Flag of India image

I'm not sure if i have understood your question properly. but as per my understanding you can put all three commands in one single script and give +x permission to that script. After that you just need to execute the script.

Avatar of srujanmiryala

ASKER

yes, i want these three commands to be included in a script file and all the jboss instances should start when i run that file... So could you help me out how to write that script file
just create a file and change permissions like below.

on the console type
vim startjboss.sh
press i to enter insert mode
now type the commands in the file

run.sh –c default  –b 0.0.0.0
run.sh –c default1 –b 0.0.0.0
run.sh –c default2 –b 0.0.0.0

press esc
type :wq

now change permission as chmod +x startjboss.sh

now you can run startjboss.sh to execute all three commands. make sure you create startjboss.sh in the same folder else you need to give complete path to run.sh command.

Yes it is first executing run.sh –c default  –b 0.0.0.0 and starting the default instance and the next two commands are not executing. And if exit the shell even the default instance is stopping. If I am not clear till now, My intention is to start these three jboss instances at a time and these need not to stop when i exit the shell.
ASKER CERTIFIED SOLUTION
Avatar of Dushyant Sharma
Dushyant Sharma
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it would also be good if you refer the url as there is a problem with stopping jboss, started this way. you'll have to manually kill the pids.

http://www.techmasala.com/2008/03/26/shell-script-to-start-and-stop-jboss/