Skip to content

Commit 9b57e15

Browse files
committed
feat: service sanager directly controls
procd 服务脚本删除 `SERVICE_DAEMONIZE=1`,systemd 服务单元更改服务类型为 exec 并添加 -f 参数 在此基础上删除 pid 文件相关内容
1 parent 9b57a83 commit 9b57e15

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

package/openwrt/files/etc/init.d/smartdns

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ START=19
1010
STOP=82
1111
NAME=smartdns
1212
USE_PROCD=1
13-
SERVICE_USE_PID=1
14-
SERVICE_WRITE_PID=1
15-
SERVICE_DAEMONIZE=1
16-
SERVICE_PID_FILE="/run/smartdns.pid"
17-
if [ ! -d "/run" ]; then
18-
SERVICE_PID_FILE="/var/run/smartdns.pid"
19-
fi
2013

2114
SMARTDNS_DOWNLOAD_TMP_DIR="/tmp/smartdns-download"
2215
SMARTDNS_DEFAULT_FORWARDING_FILE="/etc/smartdns/domain-forwarding.list"

package/redhat/smartdns.spec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ After=syslog.target network-online.target
4141
[Service]
4242
Type=simple
4343
ExecStart=/usr/sbin/smartdns -c /etc/smartdns/smartdns.conf -f
44-
PIDFile=/run/smartdns.pid
4544
Restart=on-failure
4645
KillMode=process
4746

systemd/smartdns.service.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ StartLimitBurst=0
88
StartLimitIntervalSec=60
99

1010
[Service]
11-
Type=forking
12-
PIDFile=@RUNSTATEDIR@/smartdns.pid
11+
Type=exec
1312
EnvironmentFile=@SYSCONFDIR@/default/smartdns
14-
ExecStart=@SBINDIR@/smartdns -p @RUNSTATEDIR@/smartdns.pid $SMART_DNS_OPTS
13+
ExecStart=@SBINDIR@/smartdns $SMART_DNS_OPTS -f
1514
Restart=always
1615
RestartSec=2
1716
TimeoutStopSec=15

0 commit comments

Comments
 (0)