Культурный офтопик
 help / color / mirror / Atom feed
From: Ivan Petrov <pravo@hnet.ru>
To: smoke-room@lists.altlinux.org
Subject: Re: [room] halt
Date: Sun, 24 Aug 2008 00:06:26 +0700
Message-ID: <g8pg2g$qmb$1@ger.gmane.org> (raw)
In-Reply-To: <g8pcre$hms$1@ger.gmane.org>

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, <miquels@drinkel.nl.mugnet.org>
#

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



  reply	other threads:[~2008-08-23 17:06 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-22 17:00         ` Ivan Petrov
2008-08-22 17:19           ` Alexei V. Mezin
2008-08-22 17:24             ` Vyatcheslav Perevalov
2008-08-23  2:00             ` Ivan Petrov
2008-08-23 12:54               ` Alexander Yereschenko
2008-08-22 18:04           ` Aleksey Novodvorsky
2008-08-23  1:25             ` Ivan Petrov
2008-08-24 20:02               ` Michael Shigorin
2008-08-22 19:19           ` Denis Kirienko
2008-08-23  1:35             ` Ivan Petrov
2008-08-23  6:56               ` Denis Kirienko
2008-08-22 19:24           ` Michael Pozhidaev
2008-08-22 19:29             ` Alexei V. Mezin
2008-08-22 19:53               ` Michael Pozhidaev
2008-08-23 14:22               ` Вадим Илларионов
2008-08-23 21:08               ` Michael Shigorin
2008-08-22 19:54           ` Sergey Shilov
2008-08-23  1:57             ` Ivan Petrov
2008-08-23 12:48               ` Alexander Yereschenko
2008-08-23 13:04                 ` Dmitriy Kruglikov
2008-08-23 14:15                   ` Вадим Илларионов
2008-08-23 19:11                   ` Maxim Tyurin
2008-08-24  1:26                     ` Денис Смирнов
2008-08-25 15:27                       ` Maxim Tyurin
2008-08-24  8:11                     ` Dmitriy Kruglikov
2008-08-24 13:38                       ` Vyatcheslav Perevalov
2008-08-24 20:06                       ` [room] halt! Michael Shigorin
2008-08-25  9:52                         ` Dmitriy Kruglikov
2008-08-22 20:26           ` [room] halt Denis Kirienko
2008-08-23 13:57             ` Вадим Илларионов
2008-08-23 15:29             ` Ivan Petrov
2008-08-23 16:06               ` Denis Kirienko
2008-08-23 17:07                 ` Ivan Petrov
2008-08-23 20:02                   ` Denis Kirienko
2008-08-24  6:40                     ` Ivan Petrov
2008-08-24  7:36                       ` Denis Kirienko
2008-08-24 16:21               ` Sergey Y. Afonin
2008-08-24 16:54                 ` Dmitriy Kruglikov
2008-08-24 17:04                   ` Sergey Y. Afonin
2008-08-24 20:00                 ` Michael Shigorin
2008-08-24 20:00               ` Michael Shigorin
2008-08-23 21:08           ` Michael Shigorin
2008-08-24 16:09           ` Sergey Y. Afonin
2008-08-23  9:16         ` Ivan Petrov
2008-08-23  9:29           ` Vyatcheslav Perevalov
2008-08-23  9:29           ` Dmitriy Kruglikov
2008-08-23 15:05             ` Ivan Petrov
2008-08-23 16:12               ` Denis Kirienko
2008-08-23 17:06                 ` Ivan Petrov [this message]
2008-08-23 17:48                   ` Denis Kirienko
2008-08-24 16:26                     ` Sergey Y. Afonin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='g8pg2g$qmb$1@ger.gmane.org' \
    --to=pravo@hnet.ru \
    --cc=smoke-room@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Культурный офтопик

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/smoke-room/0 smoke-room/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 smoke-room smoke-room/ http://lore.altlinux.org/smoke-room \
		smoke-room@lists.altlinux.org smoke-room@lists.altlinux.ru smoke-room@lists.altlinux.com smoke-room@altlinux.ru smoke-room@altlinux.org smoke-room@altlinux.com
	public-inbox-index smoke-room

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.smoke-room


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git