Repository navigation
Session daemons under systemd (Linux) and launchd (macOS); hqsh server setup - #3
Merged
Merged
Conversation
…erver setup Each session's daemon now starts as a systemd user unit hqsh-<session>.service (with lingering, so it survives logout) or a launchd job in user/<uid>, falling back to the detached fork. hqsh server setup [--check] reports which applies and enables lingering. HQSH_SUPERVISOR overrides the choice. systemctl/systemd-run are pointed at /run/user/UID, and the unit gets the attaching side's XDG_RUNTIME_DIR, HOME and SHELL, so the socket lands where attach dials even when the two runtime dirs differ. Co-Authored-By: Claude Opus 5.5 <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.
Anthony: "it should use systemd on *nix for hqsh server", and it must work on every server/device.
hqsh-<session>.service(systemd-run --user --collect). It is used only with lingering on, since without it logind stops user units at the last logout; then it falls back to the detached fork.sh.hqterm.hqsh.<session>bootstrapped intouser/<uid>, with the plist kept beside the sockets (not LaunchAgents, so it does not start at login).hqsh server setup [--check]reports the supervisor and enables lingering.HQSH_SUPERVISOR=fork|systemd|launchd|autooverrides.systemctl --userfinds the manager throughXDG_RUNTIME_DIR, which is also hqsh's socket dir. The systemd commands now target/run/user/UID, and the unit is handed the attaching side'sXDG_RUNTIME_DIR/HOME/SHELL.Tests
TestSessionRunsUnderTheRealServiceManagerpassed on dev2 under real systemd: the unit was active, served an attach, and was collected on exit. On macOS CI it exercises launchd; elsewhere it skips.go vetpasses for linux, darwin and windows.The Windows server (ConPTY) follows in its own PR; this keeps the Windows stub.
🤖 Generated with Claude Code