Files
pyTorrent/systemd/pytorrent.service
Mateusz Gruszczyński 31bba1269d gunicorn
2026-05-04 10:43:31 +02:00

24 lines
685 B
Desktop File

[Unit]
Description=pyTorrent web UI for rTorrent
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
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 --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
User=www-data
Group=www-data
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target