RE: Auto Shutdown of Oracle Needs Lock File in /Var/Lock/Subsys

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I ran into this with some custom processes also.  It turns out that the
"rc" command (which is what actually switches runlevels) checks to see
if there are files in /var/lock/subsys.  If the files are there, the rc
command will process K* scripts.  If they are missing, the rc command
skips the shutdown on the assumption that the processes are already
stopped.  It took me several weeks to finally figure that out.

>From /etc/rc.d/rc:
# First, run the KILL scripts.
for i in /etc/rc$runlevel.d/K* ; do
        check_runlevel "$i" || continue

        # Check if the subsystem is already up.
        subsys=${i#/etc/rc$runlevel.d/K??}
        [ -f /var/lock/subsys/$subsys -o -f
/var/lock/subsys/$subsys.init ] || continue
#####     ^^^^^ If /var/lock/subsys/subsys or subsys.init exist...  ^^^
Otherwise move to the next subsystem
#####           subsys is the name of the init script (in your case
dbora)

 
It's that test there that is causing the behavior.

The corresponding part in the startup section is:
# Now run the START scripts.
for i in /etc/rc$runlevel.d/S* ; do
        check_runlevel "$i" || continue

        # Check if the subsystem is already up.
        subsys=${i#/etc/rc$runlevel.d/S??}
        [ -f /var/lock/subsys/$subsys -o -f
/var/lock/subsys/$subsys.init ] && continue
#####     ^^^^^ If /var/lock/subsys/subsys or subsys.init exist then
move to the next subsystem since it's already up
#####           subsys is the name of the init script (in your case
dbora)

Maarten Broekman

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx] On Behalf Of Garris, Nicole
Sent: Thursday, September 13, 2007 5:21 PM
To: redhat-list@xxxxxxxxxx
Subject: Auto Shutdown of Oracle Needs Lock File in /Var/Lock/Subsys

This problem is resolved but I'm not clear why/how. I installed Oracle
Standard 10.2 on Red Hat Advanced Server 4. When rebooting the server,
automatic startup of Oracle works, but automatic shutdown does not after
following instructions in Oracle Database Administrator's Reference 10g
Release 2 for UNIX-Based Operating Systems, section 2.2.2. Turns out
that the following command(s) have to be added to the Oracle startup
script /etc/rc.d/init.d/dbora to create a file in /var/lock/subsys.

 

       su - $ORA_OWNER -c $ORACLE_HOME

        touch /var/lock/subsys/dbora

 

Can anyone explain to a Linux newbie why the file has to be added to
that folder and how the Linux start/stop procedure uses it? Thanks!

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=subscribe
https://www.redhat.com/mailman/listinfo/redhat-list



-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux