#!/bin/bash # systemd setup script # Example: Create a systemd service file cat > /etc/systemd/system/my-app.service << 'EOF' [Unit] Description=My App Service After=network.target [Service] User=$USER WorkingDirectory=/path/to/app ExecStart=/path/to/app/venv/bin/uvicorn app:app --host 0.0.0.0 --port 8000 Restart=always [Install] WantedBy=multi-user.target EOF sudo systemctl daemon-reload || echo "Warning: Failed to reload systemd" sudo systemctl start my-app || echo "Warning: Failed to start service" sudo systemctl enable my-app || echo "Warning: Failed to enable service"