onekey-udptools/systemctl/service/udp2raw-server@.service

18 lines
1.1 KiB
INI
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

[Unit] # 主要是服务说明
Description=Udp2RawServer - %i # 简单描述服务
After=network.target # 描述服务类别表示本服务需要在network服务启动后在启动
Before= # 表示需要在某些服务启动之前启动After和Before字段只涉及启动顺序不涉及依赖关系。
[Service] # 核心区域
Type=forking # 表示后台运行模式。
User=root # 设置服务运行的用户
Group=root # 设置服务运行的用户组
KillMode=control-group # 定义systemd如何停止服务
PIDFile=/usr/local/udptools/pid/udp2raw-s%i.pid # 存放PID的绝对路径
Restart=no # 定义服务进程退出后systemd的重启方式默认是不重启
ExecStart=/usr/local/udptools/udp2raw-s%i.sh start # 服务启动命令,命令需要绝对路径
ExecStop=/usr/local/udptools/udp2raw-s%i.sh stop # 服务停止命令,命令需要绝对路径
PrivateTmp=true # 表示给服务分配独立的临时空间
[Install]
WantedBy=multi-user.target # 多用户