From 99d6d5c8d590f7ad31dad41791c6a260cfef33af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20MANSUY?= Date: Thu, 4 Dec 2025 19:18:40 +0800 Subject: [PATCH] cherry-pick 0fa2fc9c --- lightrag.service.example | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lightrag.service.example b/lightrag.service.example index 3c96e0b4..e99198d1 100644 --- a/lightrag.service.example +++ b/lightrag.service.example @@ -1,5 +1,5 @@ [Unit] -Description=LightRAG XYJ Ollama Service +Description=LightRAG XYJ Service After=network.target [Service] @@ -8,10 +8,23 @@ User=netman # Memory settings MemoryHigh=8G MemoryMax=12G -WorkingDirectory=/home/netman/lightrag-xyj -ExecStart=/home/netman/lightrag-xyj/lightrag-api + +# Set the LightRAG installation directory (change this to match your installation path) +Environment="LIGHTRAG_HOME=/home/netman/lightrag-xyj" + +# Set Environment to your Python virtual environment +Environment="PATH=${LIGHTRAG_HOME}/.venv/bin" +WorkingDirectory=${LIGHTRAG_HOME} +ExecStart=${LIGHTRAG_HOME}/.venv/bin/lightrag-server +# ExecStart=${LIGHTRAG_HOME}/.venv/bin/lightrag-gunicorn + +# Kill mode require ExecStart must be gunicorn or unvicorn main process +KillMode=process +ExecStop=/bin/kill -s TERM $MAINPID +TimeoutStopSec=60 + Restart=always -RestartSec=10 +RestartSec=30 [Install] WantedBy=multi-user.target