init
initは、UNIXおよびUnix
init の
System V系 のinit
[System Vのinitは、/etc/inittab
ファイル:initdefault:
エントリを
利 点 :柔 軟 で拡 張 性 がある。欠 点 :複 雑 である。
ランレベル
[System Vのランレベル (runlevel) は、マシンの
- 0.
停 止 (Halt) - 1. シングルユーザーモード
- 6.
再 起 動 (Reboot)
これら/etc/inittab
ファイルで、
デフォルトのランレベル
[OS | デフォルトのランレベル |
---|---|
AIX | 2 |
CentOS | 3(コンソール/サーバ)または5(グラフィカル/デスクトップ)[7] |
Debian | 2[8] |
Gentoo Linux | 3[9] |
HP-UX | 3(コンソール/サーバ/マルチユーザ)または4(グラフィカル) |
macOS | 3 |
Mandriva Linux | 3(コンソール/サーバ)または5(グラフィカル/デスクトップ) |
Red Hat Linux / Fedora Core | 3(コンソール/サーバ)または5(グラフィカル/デスクトップ)[10] |
Slackware | 3 |
Solaris | 3[11] |
SUSE Linux | 3(コンソール/サーバ)または5(グラフィカル/デスクトップ)[12] |
Ubuntu | 2[8] |
$ runlevel
$ who -r
telinit
コマンドまたはinit
コマンドを/etc/inittab
ファイルの:initdefault:
エントリにある。
BSD系 のinit
[Berkeley Software Distribution (BSD) のinitは、/etc/rc
にある/etc/ttys
の/etc/rc
ファイルでinit の
利 点 :手 で変 更 ・修 正 するのが容 易 である。欠 点 : ブート時 にサードパーティーのパッケージの初 期 化 スクリプトを実 行 する必 要 がある場 合 、上 記 のスクリプトのいずれかを編 集 する必 要 があるが、ちょっとした間 違 いでブート不 可 能 な状 態 になってしまう。
BSDの/etc/rc.local
ファイルをブート
NetBSD 1.5では/etc/rc.d
ディレクトリ
initをスキップする
[initはマシンを/sbin/init
である)。これは、ブートローダのプロンプトにinit=/foo/bar
などとinit=/bin/bash
を
BSDboot -s
コマンドでシングルユーザーモードで/sbin/init
はexec()
に/bin/sh
)。
ブートが/etc/ttys
ファイルで "insecure" とされているCTRL+D
を
カーネルのブートboot -a
、FreeBSDではinit_path
というローダー
initの代 替
[initに
- GoboLinuxのBootScripts
- eINIT - initを
完 全 に置 き換 えるものであり、非 同 期 なプロセス開 始 処 理 が特 徴 。シェルスクリプトを全 く使 わない方 法 をとることも可 能 。 - Initng - initを
完 全 に置 き換 えるものであり、非 同 期 なプロセス開 始 処 理 が特 徴 。 - launchd — macOS (Mac OS X v10.4
以 降 )でのプロセス開 始 処 理 (Mac OS X v10.3以 前 はinitを使 用 )。古 いrc.local
はSystemStarterで扱 う。 - Mudur - PardusというLinuxディストリビューションで
採 用 しているPythonで書 かれたinit代 替 で、非 同 期 なプロセス起 動 が可 能 [14]。 - OpenRC - Gentoo Linuxのデフォルトのinitシステム
- Service Management Facility - Solaris 10から
導 入 されたinitの置 換 /再 設 計 - systemd - Fedora 15からデフォルトで
使 用 しているinitの代 替 。サービスを並 列 に起 動 でき、シェルのオーバーヘッドを低 減 している。 - Upstart - initを
完 全 に置 き換 えるものであり、非 同 期 なプロセス開 始 処 理 が特 徴 。Ubuntuが起 源 。
脚 注
[- ^ ISO/IEC 23360-1:2006 Linux Standard Base (LSB) core specification 3.1 Part 1: Generic specification https://www.iso.org/standard/43781.html
- ^ Linux Standard Base(LSB) 22.2. Init Script Actions https://refspecs.linuxfoundation.org/lsb.shtml
- ^ “Know Thy Ubuntu”. Help.ubuntu.com (2009
年 8月 7日 ). 2011年 6月 13日 閲 覧 。 - ^ “since we have no /etc/inittab”. Linuxquestions.org (2006
年 11月 30日 ). 2011年 6月 13日 閲 覧 。 - ^ “Upstart Plans to Ease Linux Management — Streamlining the init Processes”. Reports. LinuxPlanet (2007
年 3月 8日 ). 2011年 6月 13日 閲 覧 。 - ^ Remnant, Scott James (2006
年 8月 26日 ). “Upstart in Universe”. Netsplit.com. 2011年 6月 13日 閲 覧 。 - ^ “SysV Init Runlevels”. 2012
年 9月 22日 閲 覧 。 - ^ a b “Debian and Ubuntu Linux Run Levels”. Debianadmin.com (2009
年 4月 2日 ). 2011年 6月 13日 閲 覧 。 - ^ “Initscripts”. Gentoo Linux Documentation. Gentoo.org (2011
年 3月 2日 ). 2011年 6月 13日 閲 覧 。 - ^ “SysV Init Runlevels”. 2012
年 9月 22日 閲 覧 。 - ^ “Oracle Documentation”. Docs.sun.com (2010
年 9月 7日 ). 2011年 6月 13日 閲 覧 。 - ^ “SUSE Documentation: The init Process”. suse.com (2014
年 4月 25日 ). 2014年 5月 4日 閲 覧 。 - ^ Andrew Smallshaw (2009
年 12月 7日 ). “Unix and Linux startup scripts, Part 2”. 2012年 4月 6日 閲 覧 。 - ^ Gürer Özen, Görkem Çetin. “Speeding Up Linux: One Step Further With Pardus Pardus”. Pardus.org.tr. 2011
年 6月 13日 閲 覧 。
関 連 項 目
[外 部 リンク
[- man pages for init
init(8)
– FreeBSD System Manager's Manual Pages (en)- Paper summarizing Unix init schemes
- runit
- minit
- rc.d
- busybox