summarylogtreecommitdiffstats
path: root/xray@.service
diff options
context:
space:
mode:
Diffstat (limited to 'xray@.service')
-rw-r--r--xray@.service17
1 files changed, 17 insertions, 0 deletions
diff --git a/xray@.service b/xray@.service
new file mode 100644
index 00000000000..c7563486d11
--- /dev/null
+++ b/xray@.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Xray Service
+Documentation=https://github.com/xtls
+After=network.target nss-lookup.target
+
+[Service]
+User=nobody
+CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
+AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
+NoNewPrivileges=true
+ExecStart=/usr/bin/xray run -config /etc/xray/%i.json
+Restart=on-failure
+RestartPreventExitStatus=23
+
+[Install]
+WantedBy=multi-user.target
+