/etc/rcx.d/<script>

The reason RedHat does not kick off your K* rc shutdown scripts is because RedHat checks for a lock file for your script in /var/lock/subsys/<scriptname>

To fix this, simply add a line to your 'start' section, something like this:
Code:
touch /var/lock/subsys/<scriptname>
This will create that 0 byte file that rc is looking for when it executes shutdown.

Here is the actual snippet of the code from /etc/rc.d/rc that does this:
Code:
# 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

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章