linux 実行ファイルをdaemon化

本稿について

本稿はサイト運営者が学んだことなどを記したメモの内容です。
全てが正確な情報とは限りません。ご注意ください。また修正するべき点は適時修正していきます

$ sudo vim /etc/systemd/system/hogehoge.service


[Unit]
Description=Application Explain

[Service]
ExecStart=/etc/init.d/hogehoge
Restart=on-failure

[Install]
WantedBy=multi-user.target

実行
$ sudo systemctl start hogehoge.service

起動時に実行登録する
$ sudo systemctl enable hogehoge.service
Created symlink /etc/systemd/system/multi-user.target.wants/hogehoge.service → /etc/systemd/system/hogehoge.service.

関連ページ

Back