更新systemd.service示例

This commit is contained in:
2024-06-14 14:12:00 +00:00
committed by cloud-init created default user
parent 1ffa3da357
commit 170ea1e86a
5 changed files with 19 additions and 14 deletions

View File

@@ -25,10 +25,12 @@ Assert=i.target
[Service]
## 当前 Service 的类型可选值simple启动主进程默认forking启动子进程oneshot一次性进程dbusD-Bus进程notify当前Service启动后会通知Systemdidle当其他任务执行完毕后当前Service才会启动
Type=forking
## 启动 Service 的命令
ExecStart=
## 指定环境变量
Environment=
## 启动当前 Service 之前执行的命令
ExecStartPre=
## 启动 Service 的命令
ExecStart=
## 启动当前 Service 之后执行的命令
ExecStartPost=
## 重启当前 Service 的命令
@@ -43,8 +45,6 @@ RestartSec=
Restart=
## 停止当前 Service 之前等待的秒数
TimeoutSec=
## 指定环境变量
Environment=
# 定义如何启动,以及是否开机启动
[Install]