From 0fa2fc9cabafbb07b6410e794d59d01e65747805 Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 29 Oct 2025 20:14:17 +0800 Subject: [PATCH] Refactor systemd service config to use environment variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Add LIGHTRAG_HOME environment variable • Use .venv instead of venv directory --- lightrag.service.example | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lightrag.service.example b/lightrag.service.example index 3a342c5b..e99198d1 100644 --- a/lightrag.service.example +++ b/lightrag.service.example @@ -9,11 +9,14 @@ User=netman MemoryHigh=8G MemoryMax=12G -# Using virtual enviroment created by miniconda -Environment="PATH=/home/netman/miniconda3/bin:/home/netman/lightrag-xyj/venv/bin" -WorkingDirectory=/home/netman/lightrag-xyj -# ExecStart=/home/netman/lightrag-xyj/venv/bin/lightrag-server -ExecStart=/home/netman/lightrag-xyj/venv/bin/lightrag-gunicorn +# 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