赞
踩
[Unit]
Description=your_app
[Service]
Type=your_app
ExecStart=/root/your_app.sh
Restart=always
RestartSec=5
StartLimitInterval=0
[Install]
WantedBy=default.target
将上述文件命名为 your_app.serivce
,放入/etc/systemd/system
目录下
比如,你的服务名称叫 your_app
服务启用
sudo systemctl enable your_app
服务启动
sudo systemctl start your_app
服务重新启动
sudo systemctl restart your_app
服务停止
sudo systemctl stop your_app
服务禁用
sudo systemctl disable your_app
服务配置更新
sudo systemctl daemon-reload
服务状态
sudo systemctl status your_app
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。