瀏覽代碼

systemd: prevent restart on corrupt config

DuckSoft 5 年之前
父節點
當前提交
5751de2af5
共有 2 個文件被更改,包括 2 次插入0 次删除
  1. 1 0
      release/config/systemd/system/v2ray.service
  2. 1 0
      release/config/systemd/system/v2ray@.service

+ 1 - 0
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

+ 1 - 0
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