# service 登録する
すぐに終わるスクリプトで Restart=always などとすると無限に呼ぶので注意。
sudo vi /lib/systemd/system/my.service
[Unit] Description=startup script [Service] Type=simple ExecStart=/home/brabra/startup.sh Restart=no [Install] WantedBy=multi-user.target
# 確認
sudo systemctl list-unit-files --type=service | grep my.service
my.service desabled
# enableする
sudo systemctl enable my.service
# 確認
sudo systemctl list-unit-files --type=service | grep my.service
my.service enabled
vi startup.sh
#!/bin/sh brabra