v2ray.service 766 B

12345678910111213141516171819202122
  1. [Unit]
  2. Description=V2Ray Service
  3. After=network.target
  4. Wants=network.target
  5. [Service]
  6. # This service runs as root. You may consider to run it as another use for security concerns.
  7. # By uncommenting the following two lines, this service will run as user v2ray/v2ray.
  8. # More discussion at https://github.com/v2ray/v2ray-core/issues/1011
  9. # User=v2ray
  10. # Group=v2ray
  11. Type=simple
  12. PIDFile=/var/run/v2ray.pid
  13. ExecStart=/usr/bin/v2ray/v2ray -config /etc/v2ray/config.json
  14. Restart=on-failure
  15. RestartPreventExitStatus=23 # Configuration error
  16. # After unexpected exit, upload latest V2Ray log to official log service for future analysis.
  17. # Comment out the following line if you have privacy concerns.
  18. ExecStopPost=/usr/bin/v2ray/upload.sh
  19. [Install]
  20. WantedBy=multi-user.target