CentOS 7 systemd service开机启动设定

时间:2024-10-07 15:06:14

#vi /etc/systemd/system/xxx.service

 [Unit]
Description=startup script test [Service]
Type=simple
ExecStart=/usr/local/bin/xxx/xxx.sh
Restart=always
# RestartSec=
# TimeoutSec= [Install]
WantedBy=multi-user.target

#systemctl enable xxx.service

参考:http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-commands.html