首次提交
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
[Unit]
|
||||
Description=ecap_server Daemon
|
||||
After=network.target
|
||||
Requires=heco22.service
|
||||
After=heco22.service
|
||||
BindsTo=heco22.service
|
||||
|
||||
|
||||
# 防止启动失败 → 无限重启风暴 频率限制在 5 次 / 60 秒
|
||||
StartLimitIntervalSec=60
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStartPre=/bin/bash -c 'until ping -c 1 172.22.0.2 > /dev/null 2>&1; do echo "Waiting for network..."; sleep 3; done'
|
||||
ExecStart=/home/heco/ys_ecap_server/ecap_server
|
||||
WorkingDirectory=/home/heco/ys_ecap_server
|
||||
|
||||
# 只有失败时才重启
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
# 明确指定正常退出(0)时,不会重启
|
||||
SuccessExitStatus=0 75
|
||||
# 进程异常退出时重启 如果进程返回RestartPreventExitStatus时,不会重启
|
||||
RestartPreventExitStatus=2 3
|
||||
|
||||
|
||||
|
||||
# 或系统关机 / 重启时,systemd 首先发送给该服务主进程的信号。
|
||||
KillSignal=SIGTERM
|
||||
TimeoutStopSec=30
|
||||
# 进程文件描述符数量
|
||||
LimitNOFILE=65535
|
||||
# cat /proc/sys/kernel/core_pattern 针对单个进程 生成 core dump 等价于 ulimit -c unlimited
|
||||
LimitCORE=infinity
|
||||
|
||||
# 该服务进程 以及它 fork 的所有子进程,在运行期间 不能获得任何“新的权限”。
|
||||
NoNewPrivileges=yes
|
||||
# # 隔离临时目录
|
||||
PrivateTmp=yes
|
||||
|
||||
# 把服务进程的 标准输出(stdout), 标准错误(stderr) 重定向到 systemd journal。
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,47 @@
|
||||
[Unit]
|
||||
Description=heco22 Daemon
|
||||
After=network.target
|
||||
PartOf=ecap.service
|
||||
|
||||
|
||||
|
||||
|
||||
# 防止启动失败 → 无限重启风暴 频率限制在 5 次 / 60 秒
|
||||
StartLimitIntervalSec=60
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/heco/ys_ecap_server/start_22.sh
|
||||
|
||||
|
||||
# 只有失败时才重启
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
# 明确指定正常退出(0)时,不会重启
|
||||
SuccessExitStatus=0 75
|
||||
# 进程异常退出时重启 如果进程返回RestartPreventExitStatus时,不会重启
|
||||
RestartPreventExitStatus=2 3
|
||||
|
||||
|
||||
|
||||
# 或系统关机 / 重启时,systemd 首先发送给该服务主进程的信号。
|
||||
KillSignal=SIGTERM
|
||||
TimeoutStopSec=30
|
||||
# 进程文件描述符数量
|
||||
LimitNOFILE=65535
|
||||
# cat /proc/sys/kernel/core_pattern 针对单个进程 生成 core dump 等价于 ulimit -c unlimited
|
||||
LimitCORE=infinity
|
||||
|
||||
# 该服务进程 以及它 fork 的所有子进程,在运行期间 不能获得任何“新的权限”。
|
||||
NoNewPrivileges=yes
|
||||
# # 隔离临时目录
|
||||
PrivateTmp=yes
|
||||
|
||||
# 把服务进程的 标准输出(stdout), 标准错误(stderr) 重定向到 systemd journal。
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user