v2ray@.service 993 B

1234567891011121314151617181920212223242526
  1. [Unit]
  2. Description=V2Ray - A unified platform for anti-censorship - Profile -> %i
  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. CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_RAW
  17. NoNewPrivileges=yes
  18. ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/%i.json
  19. Restart=on-failure
  20. # Don't restart in the case of configuration error
  21. RestartPreventExitStatus=23
  22. [Install]
  23. DefaultInstance=default
  24. WantedBy=multi-user.target