参考:
https://www.cnblogs.com/shuimuqingyang/p/17916696.html
/usr/lib/systemd/system/ai.service
[Unit]
Description=AI Server
After=network.target
[Service]
ExecStart=/data/teamway/teamway220812_back/aiserver.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
软连接到/etc/systemd/system/multi-user.target.wants/ai.service
命令:
ln -s /usr/lib/systemd/system/ai_dc.service /etc/systemd/system/multi-user.target.wants/ai_dc.service
启动权限
chmod 777 /data/teamway/teamway220812_back/aiserver.sh
使用:
开机自启动:
systemctl enable ai.service
立即启动:
systemctl start ai.service
重新启动:
systemctl restart ai.service
运行状态:
systemctl status ai.service
重新加载
systemctl daemon-reload
关闭服务
systemctl stop ai.service
需要等一段时间
标签:systemd,target,service,--,system,ai,systemctl,自启动 From: https://www.cnblogs.com/shuimuqingyang/p/17997695