Shutdown Log from rc.log.old (290 Views)
Reply
Occasional Visitor
Naba_1
Posts: 3
Registered: ‎04-12-2011
Message 1 of 6 (290 Views)

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
Please use plain text.
Honored Contributor
Larry Klasmier
Posts: 891
Registered: ‎06-01-2009
Message 2 of 6 (290 Views)

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?
Please use plain text.
Honored Contributor
Bill Hassell
Posts: 14,199
Registered: ‎05-29-2000
Message 3 of 6 (290 Views)

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.
Please use plain text.
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 4 of 6 (290 Views)

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...
Please use plain text.
Occasional Visitor
Naba_1
Posts: 3
Registered: ‎04-12-2011
Message 5 of 6 (290 Views)

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
Please use plain text.
Occasional Visitor
Naba_1
Posts: 3
Registered: ‎04-12-2011
Message 6 of 6 (290 Views)

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
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation