Help with restarting of application with reboot of AIX server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with restarting of application with reboot of AIX server
# 1  
Old 08-16-2010
Question Help with restarting of application with reboot of AIX server

Hi,

We have hosted our application on AIX server. The problem is that we have to start our application manually once the server is rebooted. Please guide me in writing a script that does this job automatically with the re-start of the server. I'm looking for something like windows services in unix.

Thanks in advance!
Himanshu
# 2  
Old 08-16-2010
put your start/stop script under /etc/rc2.d
This User Gave Thanks to rdcwayx For This Post:
# 3  
Old 08-16-2010
Hi.

You have a couple of options, really.

Either use /etc/inittab, or for more control, put your start / stop script in /etc/init.d, and link your S and K scripts from /etc/rc2.d to the script.

Typically, a basic init.d script will look something like:

Code:
#!/bin/ksh

##################################################
# name: myScript.ksh
# purpose: Script to stop and start my application
##################################################

case "$1" in
start )
        :  commands used to start your application
        ;;
stop )
        :  commands used to stop your application
        ;;
* )
        echo "Usage: $0 (start | stop)"
        exit 1
esac

Then:

Code:
# ln -s /etc/init.d/myScript.ksh /etc/rc2.d/S99myScript
# ln -s /etc/init.d/myScript.ksh /etc/rc2.d/K01myScript

where S99 and K01 are the sequence during a startup / shutdown that your application will be started and stopped in relation to other S and K scripts in rc2.d.
This User Gave Thanks to Scott For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Is it mandatory or not to stop/start Applcation server ehen Restarting Database Server?

Good afternoon I need your help please. There is a Mantenance Windos which needs to Restart de Database Server 192.x.x.97 to set up some configuration Is it mandatory or not to stop/start Applcation server that runs in 192.x.x.95 ? Is it mandatory or not to stop/start apache and Tomcat?... (3 Replies)
Discussion started by: alexcol
3 Replies

2. Linux

Application services not starting with server reboot

Hi All, My application uses three different sub-services to make complete application up and running to normal. The entry of all the three services are present in /etc/init.d directory with proper softlink created to application home path where it actually exists. In one rare case one of the... (3 Replies)
Discussion started by: hk_kamozalwar
3 Replies

3. Solaris

restarting sysedge on a solaris server

If I want to restart sysedge on a solaris box and it does not want to come up. It gets stucked. How can I check where the sysedge pid file so I can delete it and try to start sysedge again? What can cause sysedge to not come up? Thanks, (0 Replies)
Discussion started by: Pouchie1
0 Replies

4. Shell Programming and Scripting

Scripting password prompt for restarting Jboss application

Hi When I do on console a stop, the script prompts for password > stop_idm_suite.sh Suite system password:Here experct of the shell script stop_idm_suite.sh DoIt() { # prompt System password echo "" ${BMC_JAVA_HOME}/java -Didm.suite.home=${BMC_IDM_SUITE_HOME} -classpath... (1 Reply)
Discussion started by: slashdotweenie
1 Replies

5. AIX

Finding Root cause of AIX server reboot itself

Hi, please explain that how to find the rootcause of aix servers reboot itself. Which log or commands should be used to analyse the reboot incident? Please explain in detail. (3 Replies)
Discussion started by: cyberkingjk
3 Replies

6. AIX

Problem with IP address when restarting AIX

Hi! I have useud SMIT to configured my static adress for AIX but when I restart the AIX the ipadress is not shown when I print netstat -in or ifconfig -a. I have to configure the ip whit smit to have it start! How can I starting the ip during boot? (6 Replies)
Discussion started by: peter.olofsson
6 Replies

7. UNIX for Dummies Questions & Answers

Help with restarting SUN m4000 server

I'm trying to power on our SUN m4000 server after a recent shutdown. When I try to connect to the xscf console I'm getting prompted for a password. The system is not asking for a login just a password. Below is the output from the xscf console. Anyone know how I can safely get back to the... (0 Replies)
Discussion started by: orahi001
0 Replies

8. Solaris

server restarting

Hello people, My solaris server is rebooting, not sure how!!! Which log should I look in to? I checked /var/adm/messages and dmesg also. How do I check older dmesg logs? I checked lastlog and also ran the last command. Nothing useful pointing to why server rebooted. Also when server reboots I... (4 Replies)
Discussion started by: rcmrulzz
4 Replies

9. Solaris

cannot telnet after restarting server

Dear guys, Pls help me this case. I telnet normally to Solaris. After restarting it manually, I can only console, cannot telnet from my latop although I can ping it. I checked /etc/default/login /usr/sbin/in.telnetd /etc/inet/inetd.conf All these files are the same. I don't see telnet... (2 Replies)
Discussion started by: wipi
2 Replies

10. Solaris

How to change Timezone without restarting teh server

Hi I have changed my timezone using the command export TZ='Asia/Calcutta" but teh affect is taking place only in teh shell where I am logged in. If I export teh variable when I open the new session, things are fine. Can I affetct the change universally, without restarting the server. ... (2 Replies)
Discussion started by: krishan
2 Replies
Login or Register to Ask a Question