Bootプロセス

Thinkpadの発熱調整(2)の調査過程
ちなみにOSはFedora9です。

  1. man bootでブートプロセスの仕組みを確認 => inittabがどうやら絡んでそうだ
  2. man inittab => /etc/rcがrunlevelを指定して実行されるらしい
  3. inittabを読んでみる => runlevelには5が指定されていた
id:5:initdefault:
  1. rcを読んでみる

ブートシーケンスを表すところだけ引用すると

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

/etc/rc5.d/にあるKから始まるスクリプトをすべて実行

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

/etc/rc5.d/にあるSから始まるスクリプトをすべて実行

  1. /etc/rc5.d/のファイル一覧を見てみると最後の方には/etc/rc.localがあります。
lrwxrwxrwx 1 root root 18 2008-09-27 18:10 S80sendmail -> ../init.d/sendmail
lrwxrwxrwx 1 root root 15 2008-08-10 19:17 S90crond -> ../init.d/crond
lrwxrwxrwx 1 root root 20 2008-09-27 18:10 S90kerneloops -> ../init.d/kerneloops
lrwxrwxrwx 1 root root 15 2008-08-10 19:45 S90smolt -> ../init.d/smolt
lrwxrwxrwx 1 root root 13 2008-08-10 19:17 S95atd -> ../init.d/atd
lrwxrwxrwx 1 root root 22 2008-08-10 19:18 S96avahi-daemon -> ../init.d/avahi-daemon
lrwxrwxrwx 1 root root 14 2008-09-27 02:11 S98cups -> ../init.d/cups
lrwxrwxrwx 1 root root 14 2008-08-16 13:38 S98wine -> ../init.d/wine
lrwxrwxrwx 1 root root 17 2008-08-10 19:20 S99anacron -> ../init.d/anacron
lrwxrwxrwx 1 root root 11 2008-09-27 02:04 S99local -> ../rc.local

このことからrcは最後にS99local、つまりrc.localを実行しているという事がわかります。

こうやって仕組みを探ってみると、rc.localに書かれていた以下の説明の意味がよくわかりますね。

# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.