0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Linux][system][directory] 初期化システム_init(SysVinit), systemd, /etc/inittab, /etc/rc[0-6].d, /etc/systemd/system/default.target, /etc/systemd/system

Last updated at Posted at 2025-02-11

初期化システム

  • Linux システムの起動とプロセス管理を担う

init(SysVinit)

  1. initの起動

    • initはカーネルによって/sbin/initが呼び出されて開始される
  2. initの実行

    • /etc/inittabで、デフォルトのランレベルを確認する
  3. ランレベルに応じたサービスの起動

    • /etc/rc[0-6].dまたは/etc/init.d/ディレクトリ以下の起動スクリプトで、システムのサービスを開始、停止、再起動する
  4. ログイン画面の表示

    • サービスがすべて起動した後、initはログインプロンプトを表示する

systemd

  1. systemdの起動
    • systemdはカーネルによって/sbin/initが呼び出されて開始される
  2. systemdの実行
    • /etc/systemd/system/default.targetで、デフォルトのターゲットを確認する
  3. ターゲットに応じたUnitの読み込み・サービスの起動
    • /etc/systemd/systemディレクトリ以下のターゲットに応じたUnitの読み込み・サービスを起動する
    • systemdは、依存関係を考慮して並列でサービスを起動する)
  4. ログイン画面の表示
    • サービスがすべて起動した後、systemdはログインプロンプトを表示します

ランレベルとターゲット

ランレベル ターゲット
対象初期化システム init(SysVinit) systemd
停止 0 poweroff.target
シングルユーザーモード 1 rescue.target
マルチユーザーモード
(テキストログイン)
2, 3, 4 multiuser.target
マルチユーザーモード
(グラフィカルログイン)
5 grafical.target
再起動 6 reboot.target

参考リンク

Ping-t

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?