From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS autolearn=no version=3.2.4 X-Injected-Via-Gmane: http://gmane.org/ To: smoke-room@lists.altlinux.org From: Ivan Petrov Date: Sun, 24 Aug 2008 00:06:26 +0700 Message-ID: References: <6c7be88d0808220349n61fdfb66sa62b1468fed9c85c@mail.gmail.com> <20080822105544.GO3310@osdn.org.ua> <6c7be88d0808230134n5d17b5b1g8e2bb6a01b1744a8@mail.gmail.com> <6c7be88d0808230229i22ee4455y37da6c98152beb2a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: host89-251-107-2.hnet.ru User-Agent: Thunderbird 2.0.0.14 (X11/20080513) In-Reply-To: Sender: news Subject: Re: [room] halt X-BeenThere: smoke-room@lists.altlinux.org X-Mailman-Version: 2.1.10b3 Precedence: list Reply-To: =?koi8-r?b?69XM2NTV0s7ZyiDPxtTP0MnL?= List-Id: =?koi8-r?b?69XM2NTV0s7ZyiDPxtTP0MnL?= List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Aug 2008 17:06:36 -0000 Archived-At: List-Archive: 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, # 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