[Unit] Description=Piper TTS HTTP server — Chinese voice (read-aloud backend for petal) After=network-online.target Wants=network-online.target # Give up loudly instead of retrying forever. This service once failed 26,800+ # times over a day without anyone noticing: RestartSec=3 means only ~3 restarts # land inside systemd's default 10s StartLimitIntervalSec, so the default burst # of 5 was never reached and the unit never entered `failed`. Widening the # window to 5 minutes makes a genuinely broken Piper show up in # `systemctl --user --failed` while still riding out transient blips. StartLimitIntervalSec=300 StartLimitBurst=5 [Service] Type=simple # Bound to loopback only — petal proxies to it; never exposed off-box. ExecStart=%h/piper/venv/bin/python -m piper.http_server \ -m zh_CN-huayan-medium \ --data-dir %h/piper/voices \ --host 127.0.0.1 --port 5006 Restart=on-failure RestartSec=3 [Install] WantedBy=default.target