v2ray.service 924 B

123456789101112131415161718192021222324
  1. [Unit]
  2. Description=V2Ray - A unified platform for anti-censorship
  3. Documentation=https://v2ray.com https://guide.v2fly.org
  4. After=network.target nss-lookup.target
  5. Wants=network-online.target
  6. [Service]
  7. # If the version of systemd is 240 or above, then uncommenting Type=exec and commenting out Type=simple
  8. #Type=exec
  9. Type=simple
  10. # Runs as root or add CAP_NET_BIND_SERVICE ability can bind 1 to 1024 port.
  11. # This service runs as root. You may consider to run it as another user for security concerns.
  12. # By uncommenting User=v2ray and commenting out User=root, the service will run as user v2ray.
  13. # More discussion at https://github.com/v2ray/v2ray-core/issues/1011
  14. User=root
  15. #User=v2ray
  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