fix: sniproxy systemd unit 去掉 NoNewPrivileges + PID 路径统一 /run/ + 注释 user daemon
This commit is contained in:
@@ -313,16 +313,9 @@ Documentation=https://github.com/dlundquist/sniproxy
|
|||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
ExecStart=$bin -c $SNIPROXY_CONF
|
ExecStart=$bin -c $SNIPROXY_CONF
|
||||||
PIDFile=/var/run/sniproxy.pid
|
PIDFile=/run/sniproxy.pid
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=3
|
RestartSec=3
|
||||||
# 最低权限
|
|
||||||
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
||||||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
|
||||||
NoNewPrivileges=yes
|
|
||||||
ProtectSystem=full
|
|
||||||
ProtectHome=yes
|
|
||||||
PrivateTmp=yes
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@@ -356,8 +349,8 @@ sniproxy_write_config() {
|
|||||||
# sniproxy.conf - stream-unlock managed
|
# sniproxy.conf - stream-unlock managed
|
||||||
# 只解析 SNI 转发, 不做 DNS
|
# 只解析 SNI 转发, 不做 DNS
|
||||||
|
|
||||||
user daemon
|
# user daemon # 不切用户, systemd 管权限
|
||||||
pidfile /var/run/sniproxy.pid
|
pidfile /run/sniproxy.pid
|
||||||
|
|
||||||
error_log {
|
error_log {
|
||||||
syslog daemon
|
syslog daemon
|
||||||
|
|||||||
Reference in New Issue
Block a user