Operating System - HP-UX
1748252 Members
3873 Online
108760 Solutions
New Discussion юеВ

Shutdown Log from rc.log.old

 
Naba_1
New Member

Shutdown Log from rc.log.old

Hi,
I have written a script to shutdown a server remotely. Shutdown process took 25 Minutes.
Rc log shows device busy, however after 25 minutes it shuts down.

Please let me know why it took 25 Minutes ? My UPS will last only 15 minutes.

rc.log.old Shows following.

***********************************************
System shutdown in progress
Sat Apr 9 16:00:05 IST 2011
***********************************************

.......
.......

Move nextboot kernel configuration into place
Output from "/sbin/rc0.d/K850kcshutdown stop":
----------------------------
* Please wait: flushing kernel registry database to disk.
* The kernel registry database has been saved to disk.
"/sbin/rc0.d/K850kcshutdown stop" SKIPPED

Unmount file systems
Output from "/sbin/rc0.d/K900localmount stop":
----------------------------
umountall: umount : has failed.
umountall: diagnostics from umount
umount: cannot unmount /dev/vg00/lvol6 : Device busy
umount: return error 1.
umountall: umount : has failed.
umountall: diagnostics from umount
umount: cannot unmount /dev/vg00/lvol7 : Device busy
umount: return error 1.
umountall: umount : has failed.
umountall: diagnostics from umount
umount: cannot unmount /dev/vg00/lvol8 : Device busy
umount: return error 1.

Stopping all Volume Manager I/O Daemons
Output from "/sbin/rc0.d/K930vxvm-daemon-kill stop":
----------------------------

***********************************************
HP-UX run-level transition completed
Sat Apr 9 16:03:35 IST 2011
***********************************************






Thanks & regards.

Naba
5 REPLIES 5
Larry Klasmier
Honored Contributor

Re: Shutdown Log from rc.log.old

There are still processes running from those files systems so something is not shutting down properly. What are those file systems, are there more? What does you remote script look like?
Bill Hassell
Honored Contributor

Re: Shutdown Log from rc.log.old

You either have to watch the entire shutdown process on the console and make note of which steps take more than a few seconds. Or modify the rc.utils file to put elapsed time on each shutdown script so you can see the delays. All well written start/stop scripts will only take a few seconds. Most likely you have some database or application that needs redesign in order to shutdown properly.

To add an elapsed time on each start/stop script, edit the file:

/sbin/rc.utils

and look for a line of dashes (about line 600-650):

echo "-------------------------- $(date)...

Just before this line, add this:

SECONDS=0

You'll look for eval and result=$? after the sleep code, about 15 lines down. Add this line right after the result=$?

result=$?
echo "${FUNCT_NAME[$I]} -- Elapsed time = $SECONDS sec" >> $LOGFILE

Then look for another row of dashes (there's only two of these in the scrip), somewhere around lines 740-790. Add the same line (SECONDS=0) before the dashed line statement and then add this echo line after result=$?:

result=$?
echo "${FUNCT_NAME[$INDEX]} -- Elapsed time = $SECONDS sec" >> $LOGFILE

NOTE: The first echo uses ${FUNCT_NAME[$I]} while the second uses ${FUNCT_NAME[$INDEX]}.
Now in both rc.log and rc.log.old, you'll have the elapsed seconds for each script. To sort them by length of time:

grep Elapsed /etc/rc.log.old | sort -nk7

The slowest scripts will be at the bottom of the list.


Bill Hassell, sysadmin
James R. Ferguson
Acclaimed Contributor

Re: Shutdown Log from rc.log.old

Hi:

In the absence of any details about what runs on the server you are shutting down, it is difficult to point to anything.

As Bill said, a likely candidate may be a database. For example, the shutdown scripts for an Oracle database might specify 'IMMEDIATE' or 'ABORT' or 'NORMAL'. Consult your DBA for what options are most appropriate for your environment. The time to execute these shutdown variants can differ significantly.

Regards!

...JRF...
Naba_1
New Member

Re: Shutdown Log from rc.log.old

Hi All,

This is a SAP application server. This script shuts down SAP first and checks if SAP is down. Then only it shuts down itself. Also it creates Output of ps -ef before shutdown ├в hy 0 command. The script is run remotely from another server.

Device busy File system lvol6,lvol7,lvol8 is for /opt,/usr and /var.

Strange thing is if this script is run now, it shutsdown properly .

Please Let me know if you want more info.

Thanks & regards.

Naba
Naba_1
New Member

Re: Shutdown Log from rc.log.old

Hi again,

I shall be away from office till 18th April, shall reply after I join office.

Meantime I have attached my shutdown script here for your inspection.

REgards.

Naba