Fix systemd service paths for correct backend location

Use /opt/zfs-manager/backend and /opt/zfs-manager/venv paths.
Simplify service configuration for reliability.

Co-Authored-By: Patrick <patrick@perlbach24.de>
This commit is contained in:
2026-04-22 01:12:44 +02:00
parent 523a3dfbf6
commit a376e9e0c9
+6 -26
View File
@@ -1,46 +1,26 @@
[Unit]
Description=ZMB Webui Backend API
After=network.target
Wants=network-online.target
[Service]
Type=notify
Type=simple
User=root
WorkingDirectory=/opt/zmb-webui/backend
WorkingDirectory=/opt/zfs-manager/backend
Environment="PATH=/opt/zfs-manager/venv/bin"
Environment="PYTHONUNBUFFERED=1"
Environment="PYTHONDONTWRITEBYTECODE=1"
# Start command with gunicorn
ExecStart=/usr/bin/python3 -m uvicorn main:app \
ExecStart=/opt/zfs-manager/venv/bin/python -m uvicorn main:app \
--host 0.0.0.0 \
--port 8000 \
--workers 2 \
--worker-class uvicorn.workers.UvicornWorker \
--timeout 30 \
--access-logfile -
--port 8000
# Process management
Restart=always
RestartSec=10
KillSignal=SIGTERM
KillMode=process
# Resource limits
MemoryLimit=512M
MemoryMax=768M
CPUQuota=75%
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=zmb-webui-backend
# Security
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
ReadWritePaths=/opt/zmb-webui/backend/config
ReadWritePaths=/opt/zfs-manager/backend
[Install]
WantedBy=multi-user.target