Files
pyTorrent/systemd/pytorrent.service
Mateusz Gruszczyński 890e3d1564 headers
2026-05-06 08:47:20 +02:00

25 lines
731 B
Desktop File

[Unit]
Description=pyTorrent Web UI
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
#User=root
#Group=root
User=pytorrent
Group=pytorrent
WorkingDirectory=/opt/pyTorrent
Environment="PYTHONUNBUFFERED=1"
EnvironmentFile=/opt/pyTorrent/.env
# Note: threaded Gunicorn preserves Flask-SocketIO background tasks without running Werkzeug in production.
ExecStart=/opt/pyTorrent/venv/bin/gunicorn -c /opt/pyTorrent/gunicorn.conf.py --worker-class gthread --workers 1 --threads 32 --bind ${PYTORRENT_HOST}:${PYTORRENT_PORT} --access-logfile - --error-logfile - wsgi:app
Restart=always
RestartSec=3
KillSignal=SIGINT
TimeoutStopSec=20
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target