packages.wenpai.net/deploy/ansible/roles/wppackages/templates/litestream.service.j2
Ben Word f73835955e
Separate Litestream into its own systemd service (#95)
Litestream's -exec wrapper prevents the Go binary from receiving
socket file descriptors, blocking future socket activation for
zero-downtime deploys. Running Litestream as an independent service
also gives cleaner restart semantics — app deploys no longer
restart replication unnecessarily.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:54:03 -05:00

16 lines
350 B
Django/Jinja

[Unit]
Description=Litestream replication for WP Packages
After=network.target
Before=wppackages.service
[Service]
Type=simple
User=deploy
Group=www-data
ExecStart=/usr/bin/litestream replicate -config {{ app_root }}/shared/litestream.yml
Restart=always
RestartSec=1s
EnvironmentFile={{ app_root }}/shared/.env
[Install]
WantedBy=multi-user.target