Skip to content

fix(install): set PYTHONUNBUFFERED=1 in launchd / systemd templates#122

Merged
oscarvalenzuelab merged 1 commit intomainfrom
fix/pythonunbuffered-in-plist
May 4, 2026
Merged

fix(install): set PYTHONUNBUFFERED=1 in launchd / systemd templates#122
oscarvalenzuelab merged 1 commit intomainfrom
fix/pythonunbuffered-in-plist

Conversation

@oscarvalenzuelab
Copy link
Copy Markdown
Collaborator

Summary

Spotted while migrating an existing install to the new `ctrlrelay install` command — the old hand-written plist had `PYTHONUNBUFFERED=1` and the new template didn't.

Without it, ctrlrelay's stdout sits in Python's stdio buffer instead of flushing line-by-line. `tail -f ~/.ctrlrelay/logs/{bridge,poller}.log` (launchd) and `journalctl -fu ctrlrelay-{bridge,poller}` (systemd) lag by minutes, which makes "is the daemon hung or just quiet?" impossible to answer during incidents.

Adds the env var to all four templates and a regression test per platform.

Test plan

  • `pytest tests/test_install.py` — 20 passed (was 18)
  • `ruff check` clean
  • Verified the rendered plist now matches the working hand-written version

Without PYTHONUNBUFFERED, ctrlrelay's stdout sits in Python's stdio
buffer instead of flushing line-by-line. tail -f on the bridge/poller
log files (launchd) and journalctl -fu (systemd) lag by minutes,
which makes 'is the daemon hung or just quiet?' impossible to answer
during incidents.

Adds the env var to all four templates and a regression test per
platform so a future template tweak can't drop it again.
@oscarvalenzuelab oscarvalenzuelab merged commit b3080e5 into main May 4, 2026
4 checks passed
@oscarvalenzuelab oscarvalenzuelab deleted the fix/pythonunbuffered-in-plist branch May 4, 2026 04:31
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.

1 participant