v2ray.service 891 B

123456789101112131415161718192021222324
  1. [Unit]
  2. Description=V2Ray - A unified platform for anti-censorship.
  3. Documentation=https://v2ray.com
  4. After=network.target nss-lookup.target
  5. Wants=network-online.target nss-lookup.target
  6. [Service]
  7. # If the version of systemd is 240 or above, then change Type=simple to Type=exec
  8. #Type=exec
  9. Type=simple
  10. # This service runs as root. You may consider to run it as another user for security concerns.
  11. # By uncommenting the following two lines, this service will run as user v2ray/v2ray.
  12. # More discussion at https://github.com/v2ray/v2ray-core/issues/1011
  13. # User=v2ray
  14. # runs as a root or add CAP_NET_BIND_SERVICE ability can bind 1 to 1024 port
  15. User=root
  16. #AmbientCapabilities=CAP_NET_BIND_SERVICE
  17. ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json
  18. Restart=on-failure
  19. # Don't restart in the case of configuration error
  20. RestartPreventExitStatus=23
  21. [Install]
  22. WantedBy=multi-user.target