From 5751de2af5cc08f7620df32f180446318ba133d8 Mon Sep 17 00:00:00 2001 From: DuckSoft Date: Sun, 6 Sep 2020 16:03:26 +0800 Subject: [PATCH] systemd: prevent restart on corrupt config --- release/config/systemd/system/v2ray.service | 1 + release/config/systemd/system/v2ray@.service | 1 + 2 files changed, 2 insertions(+) diff --git a/release/config/systemd/system/v2ray.service b/release/config/systemd/system/v2ray.service index 799dc7e8..a299209c 100644 --- a/release/config/systemd/system/v2ray.service +++ b/release/config/systemd/system/v2ray.service @@ -10,6 +10,7 @@ AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE NoNewPrivileges=true ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json Restart=on-failure +RestartPreventExitStatus=23 [Install] WantedBy=multi-user.target diff --git a/release/config/systemd/system/v2ray@.service b/release/config/systemd/system/v2ray@.service index d3cc518a..514a86aa 100644 --- a/release/config/systemd/system/v2ray@.service +++ b/release/config/systemd/system/v2ray@.service @@ -10,6 +10,7 @@ AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE NoNewPrivileges=true ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/%i.json Restart=on-failure +RestartPreventExitStatus=23 [Install] WantedBy=multi-user.target