Denis Kirienko пишет:
Ivan Petrov пишет:
unlevel сначала выполняются все KILL-скрипты,
потом все START-скрипты.

Соответственно, файл нужно было назвать K00monitor, а не E00monitor.

Назвал K00amonitor
Но не помогло. При включени выясняется, что интернет сессия открыта по прежнему.


Можете посмотреть на содержимое файла /etc/rc.d/rc, именно он эти скрипты запускает. А его в свою очередь запускает init при переходе на новый runlevel так, как это указано в inittab. Все просто!

Просто-то просто, но ничего в этом файле не пойму:
#!/bin/sh
#
# rc            This file is responsible for starting/stopping
#               services when the runlevel changes.
#
# Original Author:
#               Miquel van Smoorenburg, <[EMAIL PROTECTED]>
#

WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

# Find out what the current and what the previous runlevel are.
argv1="$1"
set `/sbin/runlevel`
runlevel="$2"
previous="$1"
export runlevel previous

# Get first argument. Set new runlevel to this argument.
[ -z "$argv1" ] || runlevel="$argv1"

# Initialize bootsplash subsystem.
splash_init

# See if we want to be in user confirmation mode.
CONFIRM=
if [ "$previous" = "N" ]; then
        splash_update start

        if [ -f /var/run/confirm ] || grep -iwqs confirm /proc/cmdline; then
                rm -f /var/run/confirm
                CONFIRM=yes
                echo $"Entering interactive startup"
        else
                echo $"Entering non-interactive startup"
        fi
fi

# Is there an rc directory for this new runlevel?
[ -d "/etc/rc.d/rc$runlevel.d" ] || exit 0

check_script()
{
        # Check if the script is there.
        [ -x "$1" ] || return 1

        # Don't run *.rpm* and *~ scripts.
        [ "${1%.rpm*}" = "$1" -a "${1%\~}" = "$1" ] || return 1

        return 0
}

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

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

        splash_update "$subsys"

        # Check if the subsystem is already up.
[ -f "/var/lock/subsys/$subsys" -o -f "/var/lock/subsys/$subsys.init" ] || continue

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

# Now run the START scripts.
for i in "/etc/rc.d/rc$runlevel.d"/S*; do
        check_script "$i" || continue

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

        splash_update "$subsys"

        # Check if the subsystem is already up.
[ -f "/var/lock/subsys/$subsys" -o -f "/var/lock/subsys/$subsys.init" ] && continue

        # If we're in confirmation mode, get user confirmation.
        if [ -n "$CONFIRM" ]; then
                confirm "$subsys"
                case $? in
                        0) : ;;
                        2) CONFIRM= ;;
                        *) continue ;;
                esac
        fi

if [ "$subsys" = halt -o "$subsys" = reboot -o "$subsys" = single -o "$subsys" = local ] \
                || egrep -qs '(action|daemon|msg_) ' "$i"; then
                "$i" start
        else
                action "Starting $subsys:" "$i" start
        fi
done

if [ "$runlevel" != 0 -a "$runlevel" != 6 ]; then
        splash_update stop
fi

_______________________________________________
smoke-room mailing list
[email protected]
https://lists.altlinux.org/mailman/listinfo/smoke-room

Ответить