LoginSignup
14
12

More than 5 years have passed since last update.

init upstart systemd supervisord の違い

Last updated at Posted at 2017-05-16

起動時にコマンドを実行する昔ながらの単純な方法: /etc/rc.local にコマンドを追加する。Ubuntu なら今でも動くが他の Linux では起動方式によって色んな設定を書く。

  • SystemV init: 昔からあるやつ
    • 設定ファイル例: /etc/init.d/ssh
    • 起動停止: service
    • 自動起動停止: chkconfig
  • upstart: Ubuntu 12 ではこれになっていた
    • 設定ファイル例: /etc/init/ssh.conf
    • 起動停止: start ssh
    • 自動起動停止: initctl
  • systemd: Ubuntu 16 ではこれになっていた
    • 設定ファイル例: /lib/systemd/system/ssh.service
    • 起動停止: systemctl
    • 自動起動停止: systemctl
  • supervisord: ユーザ権限でも設定出来る。
    • 設定ファイル例: /etc/supervisor/conf.d/*.conf
    • 起動停止: supervisorctl stop
    • 自動起動停止: 起動のみ、停止は出来ない。

supervisord 設定例

cat <<EOT > /etc/supervisor/conf.d/web3001.conf
[program:web3001]
command=/usr/bin/python -m SimpleHTTPServer 3001
stdout_logfile=/var/log/web3001.log
redirect_stderr=true
directory=/
EOT

参考

14
12
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
14
12