Sponsored Content
Top Forums Shell Programming and Scripting Single Startup script for Apache/jboss Post 302506605 by Chubler_XL on Monday 21st of March 2011 11:15:35 AM
Old 03-21-2011
How about something like this:

Code:
#!/bin/sh
LOGFILE=/tmp/start-mws-servers.log
SCRIPT_DIR=~/bin
 
logmsg () {
  echo $(date): $1 >> $LOGFILE
}
 
while read instance
do
    if [ -x  "${SCRIPT_DIR}/$instance" ] ; then
        logmsg "Recycle $instance..."
        "${SCRIPT_DIR}/$instance" start >> $LOGFILE 2>&1
    else
        logmsg "Cannot find recycle script for $instance - not starting"
    fi
done < "${SCRIPT_DIR}/active-servers"
logmsg "Start script execution complete"

This User Gave Thanks to Chubler_XL For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Startup script

New in Unix, I am adding a line "route add 57.14.y.y 57.14.x.x" every day after rebooting the system. Where can I add the line so during boot up (the system is re-started every day by design (???) the line is executed? (I tried the /etc/rc2.d/S90 but for some reason the line needs to be added... (2 Replies)
Discussion started by: texaspanama
2 Replies

2. Shell Programming and Scripting

Solaris Startup script for Apache.

I'm running Solaris 5.9 and Apache 2.... I've created a startup script for Apache....but it doesn't work!!! it resides in /etc/init.d and has a link to /etc/rc3.d and if it run it as /etc/init.d/apache_start stop it stops the httpd services and /etc/init.d/apache_start start starts the... (3 Replies)
Discussion started by: Zak
3 Replies

3. AIX

Creating startup service for JBoss

Hello Friends, Does anyone know how to create a startup script for Jboss on IBM AIX 5.3? Please help me, I'd be highly grateful to you... Thanks & Regards, Vinit (0 Replies)
Discussion started by: vpatil6688
0 Replies

4. Shell Programming and Scripting

Script to monitor JBoss web server

Hello All, I need a shell script to monitor JBOSS web server.If the JBOSS web server is down, then the script should send a mail. Please help on this. Regards, Sachin (2 Replies)
Discussion started by: nsachin
2 Replies

5. Shell Programming and Scripting

Apache Startup Fails with PHP Error

Great tins massive! Im Manqoba from Midrand, South Africa... I have installed Apache and PHP on a solaris 9 box, using the packages below: apache-2.2.14-sol9-sparc-local php-5.2.13-sol9-sparc-local After installing the packages I edited my httpd.conf file, to load the php5 module when... (10 Replies)
Discussion started by: Macarena S.A
10 Replies

6. AIX

startup script

Hi I need the below script to be started whenever I reboot my aix server ? #cat cdbegin /cdirect/cdunix/ndm/bin/cdpmgr -i /cdirect/cdunix/ndm/cfg/cbspsdb01/initparm.cfg Please suggest how to add this to the startup ? (2 Replies)
Discussion started by: samsungsamsung
2 Replies

7. Shell Programming and Scripting

Recycle Jboss server script

Hello, I need help writing a script to restart our Jboss server when it crashes. I am not very good with scripting but here is the basics. 1) I'm hoping to use KornShell 2) The command to stop the Jboss is "/var/opt/HP/ALM/jboss/bin/run.sh stop" 3) I want to verify the jboss is stopped before... (1 Reply)
Discussion started by: Blogger11
1 Replies

8. Shell Programming and Scripting

Apache tomcat startup script not booting at startup.

I copied the script from an AskUbuntu post - #!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO ... (14 Replies)
Discussion started by: Hijanoqu
14 Replies

9. Shell Programming and Scripting

Startup script

I can't quite find a clear answer on how to properly write a start up script. Does anybody have any ideas?? (3 Replies)
Discussion started by: Huitzilopochtli
3 Replies
asadmin-start-instance(1AS)					   User Commands				       asadmin-start-instance(1AS)

NAME
asadmin-start-instance, start-instance - starts a server instance and all the services associated with it SYNOPSIS
start-instance [--user admin_user] [--password admin_password] [--host local_host] [--port 4848] [--local=false] [--domain domain_name] [--debug=false] [--passwordfile filename] [--secure|-s] instance_name Use the start-instance command to start an instance with the instance name you specify. The start-instance command can be run both locally and remotely. To start locally, with a domain name identified, the named instance must already exist within that domain. To start remotely, the administration server must be running on the hostname and port number specified. The user authenticates using the password identified for the administration server. OPTIONS
--user administrative user associated for the instance. --password administrative password corresponding to the administrative user. --host host name of the machine hosting the administrative instance. --port administrative port number associated with the administrative host. --local determines if the command should delegate the request to administrative instance or run locally. --domain name of the domain. --debug starts the instance in debug mode. --passwordfile file containing passwords appropriate for the command (e.g., administrative instance). --secure if true, uses SSL/TLS to communicate with the administrative instance. OPERANDS
instance_name name of the instance to be started. Example 1: Using start-instance in local mode asadmin> start-instance --domain domain1 admin-server Instance admin-server started Where: the admin-server instance is started on the local domain1 domain. Example 2: Using start-instance in remote mode asadmin> start-instance --user admin --password bluestar --host localhost --port 4848 server1 Instance server1 started Where: the server1 instance is started on the remote domain associated with the specified user, password, host, and port number. EXIT STATUS
0 command executed successfully 1 error in executing the command INTERFACE EQUIVALENT
Server Instance page asadmin-delete-instance(1AS), asadmin-create-instance(1AS), asadmin-stop-instance(1AS), asadmin-restart-instance(1AS), asadmin-start- appserv(1AS), asadmin-stop-appserv(1AS), asadmin-start-domain(1AS),.asadmin-stop-domain(1AS) J2EE 1.4 SDK March 2004 asadmin-start-instance(1AS)
All times are GMT -4. The time now is 07:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy