I have apache ,jboss and jon instances on various linux boxes.I need to create a generic startup script to restart those instances on server reboot.The script requirement is :
It should take the name of instances from one text file named active-servers and recycle those instances.
start-mws-servers (generic script for /etc/rc.d but just create it in ~/bin dir for current testing)
It simply searches ~/bin/active-servers for active server recycle scripts
It executes each recycle script and passes it the 'start' command
It logs results to /tmp/start-mws-servers.log so we can review it after a machine recycle
Please help.
Thanks it worked, however my active instances are installed on different path and also only start command wont work for all the instances.The script provided by you will work only when i make startup-scripts separately on the name of instances and then run the provided script.
Is there any way , to merge all the startup scripts in one , so that there will be single start up script.
I'd assume that each instance would need to have some sort of configuration parameters (eg apache would have it's own httpd.conf to setup a different listen port, server root, etc).
One way to deal with this is enhance the details stored in your active-servers.txt eg:
Nice thing about this is you have a one-stop-shop for setting up all these servers, the down side is the start (and stop) scripts will need to be more complex to parse and validate this file.