UpStart
OnHubでrootを取ったので ChromeOS をちょっと調べてるとUpStartを知った。Linuxの起動プロセスは init → systemd へ移行するもんかと認識していたが、 sysinit → upstart → systemd な流れのようで、Cent6もupstartみたい。
upstart以降の特徴として下記あたり。
- サービス起動が(部分的に)並列化できるので起動が早い
- 起動・終了制御が容易
- 異常終了してもUpstartが再起動してくれる。
仕組み
こんな感じhttp://coewww.rutgers.edu/www1/linuxclass2012/lessons/startup/upstart.php
/etc/init 以下の設定ファイルを読み込んで、(且つ、後方互換用にrc-sysinit.confも読む)システムの起動/停止や、サービス/タスクの起動/停止、ハードウェアの着脱といったイベントをキャッチして色んなサービスを起動する。
設定例(デーモン化)
description "説明" author "名前 <メアド>" start on runlevel [(Run Level)] stop on runlevel [(Run Level)] chdir 作業ディレクトリ exec 起動コマンド respawn ★キモ
設定例(スタートアップ設定)
設定反映
$ sudo initctl reload-configuration $ sudo initctl list | grep サービス名
起動
$ sudo initctl start サービス名 killしてみる$ ps axf $ sudo kill 2389 $ sudo initctl list | grep サービス名→ 再起動してる。。 停止
$ sudo initctl stop サービス名その他
initctl check-config: 設定ファイルのチェック initctl reload: kill -HUP します initctl restart: 再起動します
start on 前提イベント ※イベントは定義可能。ジョブ名もイベントになる。 start on started 前提イベント respawn pre-start exec post-start exec stop on exec 単一行コマンド script 複数行スクリプト end script task
http://equj65.net/tech/systemd-boot/
http://upstart.ubuntu.com/cookbook/
http://www.usupi.org/sysad/188.html
http://www.usupi.org/sysad/189.html
http://gihyo.jp/admin/serial/01/ubuntu-recipe/0358
https://wiki.ubuntu.com/SystemdForUpstartUsers
http://upstart.ubuntu.com/cookbook/
http://www.usupi.org/sysad/188.html
http://www.usupi.org/sysad/189.html
http://gihyo.jp/admin/serial/01/ubuntu-recipe/0358
https://wiki.ubuntu.com/SystemdForUpstartUsers
登録:
コメントの投稿
(
Atom
)
0 件のコメント :
コメントを投稿