Skip to content

Separate Litestream into its own systemd service#95

Merged
retlehs merged 1 commit intomainfrom
refactor/separate-litestream-service
Apr 4, 2026
Merged

Separate Litestream into its own systemd service#95
retlehs merged 1 commit intomainfrom
refactor/separate-litestream-service

Conversation

@retlehs
Copy link
Copy Markdown
Member

@retlehs retlehs commented Apr 4, 2026

Summary

  • Extract Litestream replication from litestream -exec wrapper into a standalone litestream.service
  • Run the Go binary directly in wppackages.service, with Requires= and After= ordering on Litestream
  • Stop/disable legacy socket unit before removal to avoid stale listeners
  • Notify restart handlers on service template changes so existing hosts pick up the new ExecStart

Why

The litestream -exec wrapper prevents the Go binary from receiving
socket file descriptors, which blocks socket activation for zero-downtime
deploys (#67). Separating the services also means app deploys no longer
bounce Litestream replication unnecessarily.

Ref: #67 (comment)

Test plan

  • Run provision and verify litestream.service is installed, enabled, and active
  • Confirm wppackages.service starts after Litestream and serves traffic
  • Verify Litestream replication continues during deploy (app restart should not restart Litestream)
  • Check journalctl -u litestream for healthy replication after provision

🤖 Generated with Claude Code

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>
@retlehs retlehs self-assigned this Apr 4, 2026
@retlehs retlehs requested a review from swalkinshaw April 4, 2026 15:52
@retlehs retlehs merged commit f738359 into main Apr 4, 2026
5 checks passed
@retlehs retlehs deleted the refactor/separate-litestream-service branch April 4, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants