Operating System - HP-UX
1825759 Members
2212 Online
109687 Solutions
New Discussion

shutting down & restarting applications

 
Ravinder Singh Gill
Regular Advisor

shutting down & restarting applications

my team is about to perform a memory upgrade on a server. I have been told to outline the steps to be taken. I have been told that the application must be stopped/shutdown before the system is shutdown & must be restarted afterwards. However this must not be done from the rc scripts. Can anybody tell me the correct procedure.
5 REPLIES 5
Jannik
Honored Contributor

Re: shutting down & restarting applications

In /sbin/init.d you have all the start and stop script.
Most applications are started in run level 3 all the links are at:
/sbin/rc3.d

some thing like this:
S823hpws_apache -> /sbin/init.d/hpws_apache

say in this i would like to stop the appache application i would do this:
/sbin/init.d/hpws_apache stop
and to start it again:
/sbin/init.d/hpws_apache start

normaly most applications started at rc3.d would be stoped at rc4.d:
/sbin/rc4.d and would look like this:
K823hpws_apache -> /sbin/init.d/hpws_apache

S - for start
K - for kill

Hope it helps!
jaton
Ranjith_5
Honored Contributor

Re: shutting down & restarting applications

Hi Mr.Gill,

Normally you need to only shutdown the database running.Assuming Oracle is your data base,the procedure could be the following.

Before that ensure that the front end of your application is down. This procedure is different for different setups.

Shutdown the listner before shutting down the database.See following.
=========================================================================


login as root.

#su - oradb < equivalent oracle db user >

[/home/oradb]$ ps -ef|grep tnslsnr
testing_db 16234 1 0 Feb 27 ? 1:36 /testing_db/app/oracle/product/9.2.0/bin/tnslsnr TESTING_DB -inherit

[/home/oradb]$ /testing_db/app/oracle/product/9.2.0/bin/tnslsnr TESTING_DB stop

This will stop the Oracle listener.



Shutting Down Database:-
===================================

[/home/oradb]sqlplus /nolog

SQL*Plus: Release 8.1.7.0.0 - Production on Mon Feb 28 15:58:25 2005

(c) Copyright 2000 Oracle Corporation. All rights reserved.

SQL> connect /as sysdba
Connected.
SQL> shutdown immediate

This will shutdown the database. Give some time to get the database down.


SQL>exit

After exting from sqlPlus come to root login.

#ps -ef|grep pmon
#ps -ef|grep smon

no related process should be running.

If every thing OK shutdown the server

#shutdown -h -y now

Hope this helps.

Regards,
Syam
Ranjith_5
Honored Contributor

Re: shutting down & restarting applications

Hi Mr.Gill,

Speak to your DBA team before proceeding Please. They must have prepared a well defined procedure for your site on this.

Regards,
Syam
Jeff Lightner_1
Frequent Advisor

Re: shutting down & restarting applications

Are you sure you're not allowed to use the rc scripts? Perhaps what they meant to say is they don't want to have the shutdown of the server run the rc scripts? When it comes right down to it these are just scripts.

I suspect that management doesn't trust that there will be a proper shutdown of applications before the server. If this is the problem you can just say your procedure is to do:

1) /sbin/init.d/ stop
2) ps -ef |grep to verify its no longer running.
3) shutdown (-h 0 to halt or -r 0 to reboot)

If that still isn't sufficient you can read the /sbin/init.d/ script to determine what it is doing when it shuts down (look at the "stop" function within it) then simply detail these steps.

You'll of course need to determine which script does the stop and what processes to look for to verify its not running. Look at /etc/rc.log.old to see what it did during your last shutdown.
Mark Ellzey
Valued Contributor

Re: shutting down & restarting applications

Mr. Gill,

The only other way to start processes at boot time is with the /etc/inittab file. This, however, is NOT recommended, as this file is for system processes only. No logging to the /etc/rc.log file takes place when using inittab. Also, there is no way to gracefully stop a process when using this method.

Regards,
Mark