[Unit] Description=Workshop C2 FastAPI service After=network.target [Service] Type=simple WorkingDirectory=/root/workshop-c-and-c ExecStart=/usr/bin/python3 main.py # Ensure common system paths are available when using /usr/bin/env Environment=PATH=/usr/local/bin:/usr/bin:/bin Environment=PYTHONUNBUFFERED=1 # Automatically restart the process if it exits/crashes Restart=always RestartSec=5 # Log to the journal/syslog with a clear identifier StandardOutput=journal StandardError=journal SyslogIdentifier=workshop-c2 # (Optional) Uncomment and set a non-root user if desired #User=www-data #Group=www-data [Install] WantedBy=multi-user.target