# systemd unit - PiePIM V2 FastAPI (uvicorn, HTTP only) # # Goal: keep V2 HTTP responsive and run V2 queue processing in its own worker unit. # # Install: # sudo cp scripts/systemd/piepim-v2-api.service /etc/systemd/system/ # sudo systemctl daemon-reload # sudo systemctl enable --now piepim-v2-api.service # journalctl -u piepim-v2-api.service -f # # Edit User / WorkingDirectory / EnvironmentFile / paths to match the server. [Unit] Description=PiePIM V2 API (uvicorn) After=network-online.target postgresql.service Wants=network-online.target [Service] Type=simple User=homesurplus Group=homesurplus WorkingDirectory=/home/homesurplus/PlytixMage Environment=PYTHONUNBUFFERED=1 Environment=PATH=/home/homesurplus/PlytixMage/.venv/bin:/usr/bin # Optional: EnvironmentFile=-/home/homesurplus/PlytixMage/.env Environment=UVICORN_HOST=127.0.0.1 Environment=V2_PORT=13811 Environment=UVICORN_RELOAD=false # Keep the V2 API enqueue-only when the dedicated V2 worker unit is running. Environment=V2_SYNC_WORKER_ENABLED=false ExecStart=/home/homesurplus/PlytixMage/.venv/bin/python main_v2.py Restart=always RestartSec=5 StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target