Systemdに自作サービスを登録する
#Systemd
手順
Unit定義ファイル作成
/etc/systemd/system/サービス名.service
code:test.service
Unit
Description = test daemon
Service
ExecStart = /usr/local/bin/test.sh
Restart = always
Type = simple
Install
WantedBy = multi-user.target
サービスの有効化
systemctl enable サービス名
systemctl start サービス名