Conversation
Without `loginctl enable-linger`, systemd-logind tears down the
per-user `systemd --user` instance after the last session ends, and
imcodes goes down with it. Result: every server set up via
`imcodes bind` "mysteriously" loses its daemon overnight, comes back
when the operator next SSHes in (which restarts the user manager and
auto-starts the unit), then drops again on the next disconnect.
Caught on 212/213/215 (2026-05-09). All three were bound via
`imcodes bind`. `setup-flow.ts.installSystemdService` already had the
linger call (since 2026-04, line 415); `bind-flow.ts` was missing it
— this commit copies the same try/catch pattern over.
Pinned with a contract test that scans both source files for the
`execSync(... loginctl enable-linger ...)` invocation. Source-content
scan is the right tool here: a unit-test mock harness for a single
execSync call would be heavier than the bug fix, and the failure
mode ("daemon disappears overnight") is exactly the kind of silent
regression that future refactors invite if the call gets removed
without a tripwire.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without
loginctl enable-linger, systemd-logind tears down the per-usersystemd --userinstance after the last session ends, and imcodes goes down with it. Result: every server set up viaimcodes bind"mysteriously" loses its daemon overnight, comes back when the operator next SSHes in (which restarts the user manager and auto-starts the unit), then drops again on the next disconnect.Caught on 212/213/215 (2026-05-09). All three were bound via
imcodes bind.setup-flow.ts.installSystemdServicealready had the linger call (since 2026-04, line 415);bind-flow.tswas missing it — this commit copies the same try/catch pattern over.Pinned with a contract test that scans both source files for the
execSync(... loginctl enable-linger ...)invocation. Source-content scan is the right tool here: a unit-test mock harness for a single execSync call would be heavier than the bug fix, and the failure mode ("daemon disappears overnight") is exactly the kind of silent regression that future refactors invite if the call gets removed without a tripwire.