From 66d8d563eba3914280b5b4283603c20f3c5d0889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Mon, 28 Nov 2022 17:46:30 +0800 Subject: [PATCH] Add WorkingDirectory for systemd service --- release/config/sing-box.service | 1 + release/config/sing-box@.service | 1 + release/local/sing-box.service | 1 + 3 files changed, 3 insertions(+) diff --git a/release/config/sing-box.service b/release/config/sing-box.service index 6369b1ba..707efe5d 100644 --- a/release/config/sing-box.service +++ b/release/config/sing-box.service @@ -4,6 +4,7 @@ Documentation=https://sing-box.sagernet.org After=network.target nss-lookup.target [Service] +WorkingDirectory=/var/lib/sing-box CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE ExecStart=/usr/bin/sing-box run -c /etc/sing-box/config.json diff --git a/release/config/sing-box@.service b/release/config/sing-box@.service index e12a46e1..d6292a04 100644 --- a/release/config/sing-box@.service +++ b/release/config/sing-box@.service @@ -4,6 +4,7 @@ Documentation=https://sing-box.sagernet.org After=network.target nss-lookup.target [Service] +WorkingDirectory=/var/lib/sing-box-%i CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE ExecStart=/usr/bin/sing-box run -c /etc/sing-box/%i.json diff --git a/release/local/sing-box.service b/release/local/sing-box.service index 9a234645..94fce13d 100644 --- a/release/local/sing-box.service +++ b/release/local/sing-box.service @@ -4,6 +4,7 @@ Documentation=https://sing-box.sagernet.org After=network.target nss-lookup.target [Service] +WorkingDirectory=/var/lib/sing-box CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE ExecStart=/usr/local/bin/sing-box run -c /usr/local/etc/sing-box/config.json