1.コマンドを作って実行権付与
2./etc/systemd/system/ の下にUnit定義ファイルを作る
3.serviceとして認識されたか確認
systemctl list-unit-files –type=service
4.再起動
reboot
5.サービス起動&自動起動ON
systemctl enable “サービス名”
systemctl start “サービス名”
[linux]systemdで自作コマンドをサービス化
![](https://zukkie.link/wp-content/uploads/2022/02/martin-wettstein-4CVMWrWh3xU-unsplash-scaled.jpg)
1.コマンドを作って実行権付与
2./etc/systemd/system/ の下にUnit定義ファイルを作る
3.serviceとして認識されたか確認
systemctl list-unit-files –type=service
4.再起動
reboot
5.サービス起動&自動起動ON
systemctl enable “サービス名”
systemctl start “サービス名”
コメント