I have a user process that needs to be shutdown cleanly on a reboot or a
halt.  I tried simply placing a symlink to my script that will shut it
down named /etc/rc.d/rc6.d/K06killscript but did not work.  It appears
rc will only call the script if this script exists (it does), or if it
can find a file in /var/lock/subsys see below from /etc/rc.d/rc:

                # Check if the subsystem is already up.
                subsys=${i#/etc/rc.d/rc$runlevel.d/K??}
                [ ! -f /var/lock/subsys/$subsys ] && \
                    [ ! -f /var/lock/subsys/${subsys}.init ] && continue

                # Bring the subsystem down.
                if egrep -q "(killproc |action )" $i ; then
                        $i stop
                else
                        action "Stopping $subsys" $i stop
                fi


The user the process runs under does not have access to write to
/var/lock/subsys for obvious reasons and does not need to run as root.  

Is there a mechanism similar to rc.local to run scripts before shutdown
or do I have to make the thing smart enough to trap the kill signal and
kill itself?  The problem with that is that it is an X program and xfs
has long since been killed by the time killall5 is called.

I hate to modify the basic rc script but will do so if that is the only
way.  

btw what does this do (from the rc script also)

subsys=${i#/etc/rc.d/rc$runlevel.d/S??}

I am assuming that i is the i in the for loop this statement is in but
the combination of ${i# etc has me stumped

TIA 
Bret



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to