[Unit] Description=Pocket TTS Discord Bot After=network-online.target Wants=network-online.target [Service] # Replace with your username User=YOUR_USERNAME Group=YOUR_USERNAME # Replace with the actual path to your bot directory WorkingDirectory=/home/YOUR_USERNAME/PocketTTSBot # Use the Python from the virtual environment ExecStart=/home/YOUR_USERNAME/PocketTTSBot/venv/bin/python bot.py # Restart on failure Restart=on-failure RestartSec=10 # Give the bot time to gracefully shutdown TimeoutStopSec=30 # Logging StandardOutput=journal StandardError=journal SyslogIdentifier=pockettts # Security hardening (optional but recommended) NoNewPrivileges=true ProtectSystem=strict ProtectHome=read-only ReadWritePaths=/home/YOUR_USERNAME/PocketTTSBot/voices PrivateTmp=true [Install] WantedBy=multi-user.target