My page title

Linux Service/Systemctl 服务配置

本项目配置

[Unit]
Description= Qyue Api
After=network.target

[Service]
Type=simple
WorkingDirectory= /opt/api/bin
ExecStart= python3 api.py
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
KillMode=process
RestartSec=5s

[Install]
WantedBy=multi-user.target

参考配置

[Unit]
Description= 说明

[Service]

Type=simple

WorkingDirectory= 执行路径

ExecStart= java -jar ***.jar

ExecReload=/bin/kill -HUP $MAINPID

Restart=on-failure

KillMode=process

RestartSec=5s

[Install]

WantedBy=multi-user.target
原文链接:https://blog.csdn.net/csdn_zhangjinyu/article/details/122585191
浙ICP备18035094号-1管理