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:
@@ -1,46 +1,26 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=ZMB Webui Backend API
|
Description=ZMB Webui Backend API
|
||||||
After=network.target
|
After=network.target
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=notify
|
Type=simple
|
||||||
User=root
|
User=root
|
||||||
WorkingDirectory=/opt/zmb-webui/backend
|
WorkingDirectory=/opt/zfs-manager/backend
|
||||||
|
Environment="PATH=/opt/zfs-manager/venv/bin"
|
||||||
Environment="PYTHONUNBUFFERED=1"
|
Environment="PYTHONUNBUFFERED=1"
|
||||||
Environment="PYTHONDONTWRITEBYTECODE=1"
|
Environment="PYTHONDONTWRITEBYTECODE=1"
|
||||||
|
|
||||||
# Start command with gunicorn
|
ExecStart=/opt/zfs-manager/venv/bin/python -m uvicorn main:app \
|
||||||
ExecStart=/usr/bin/python3 -m uvicorn main:app \
|
|
||||||
--host 0.0.0.0 \
|
--host 0.0.0.0 \
|
||||||
--port 8000 \
|
--port 8000
|
||||||
--workers 2 \
|
|
||||||
--worker-class uvicorn.workers.UvicornWorker \
|
|
||||||
--timeout 30 \
|
|
||||||
--access-logfile -
|
|
||||||
|
|
||||||
# Process management
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
KillSignal=SIGTERM
|
|
||||||
KillMode=process
|
|
||||||
|
|
||||||
# Resource limits
|
|
||||||
MemoryLimit=512M
|
|
||||||
MemoryMax=768M
|
|
||||||
CPUQuota=75%
|
|
||||||
|
|
||||||
# Logging
|
|
||||||
StandardOutput=journal
|
StandardOutput=journal
|
||||||
StandardError=journal
|
StandardError=journal
|
||||||
SyslogIdentifier=zmb-webui-backend
|
SyslogIdentifier=zmb-webui-backend
|
||||||
|
|
||||||
# Security
|
ReadWritePaths=/opt/zfs-manager/backend
|
||||||
NoNewPrivileges=true
|
|
||||||
ProtectSystem=strict
|
|
||||||
ProtectHome=yes
|
|
||||||
PrivateTmp=yes
|
|
||||||
ReadWritePaths=/opt/zmb-webui/backend/config
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
Reference in New Issue
Block a user