lightrag.service.example 741 B

123456789101112131415161718192021222324252627282930
  1. [Unit]
  2. Description=LightRAG XYJ Service
  3. After=network.target
  4. [Service]
  5. Type=simple
  6. User=netman
  7. # Memory settings
  8. MemoryHigh=8G
  9. MemoryMax=12G
  10. # Set the LightRAG installation directory (change this to match your installation path)
  11. Environment="LIGHTRAG_HOME=/home/netman/lightrag-xyj"
  12. # Set Environment to your Python virtual environment
  13. Environment="PATH=${LIGHTRAG_HOME}/.venv/bin"
  14. WorkingDirectory=${LIGHTRAG_HOME}
  15. ExecStart=${LIGHTRAG_HOME}/.venv/bin/lightrag-server
  16. # ExecStart=${LIGHTRAG_HOME}/.venv/bin/lightrag-gunicorn
  17. # Kill mode require ExecStart must be gunicorn or unvicorn main process
  18. KillMode=process
  19. ExecStop=/bin/kill -s TERM $MAINPID
  20. TimeoutStopSec=60
  21. Restart=always
  22. RestartSec=30
  23. [Install]
  24. WantedBy=multi-user.target