LoginSignup
2
0

More than 5 years have passed since last update.

systemdでforeverを起動しようとしてハマったときのメモ(Ubuntu 16.04)

Last updated at Posted at 2017-04-30

systemdに慣れていないためにハマったのでメモしておく。

結論

systemdのUnitファイルでtypeがsimple(デフォルト)になっている場合、
ExecStartのコマンドはforkしてはいけない。

経緯

Node.js製Wiki Crowiを、foreverでデーモン化し、
/etc/init.dに起動スクリプトを置いて管理していた状況から、
Ubuntu 16.04へのアップグレードする際に
systemdのUnitファイルを作成して管理する方法に変更。
その後、Crowiが起動しなくなった。

対処

Type=forkingに変更する

変更前
Type = simple
変更後
Type = forking

または、forkしないコマンドに変更。

変更前
ExecStart = forever start app.js
変更後
ExecStart = node app.js
2
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
2
0