Skip to content

[TASK-30] Services: Serve the board and maps on macOS through launchd - #55

Merged
daemorgue merged 2 commits into
mainfrom
tasks/task-30-launchd-services
Nov 21, 2026
Merged

daemorgue merged 2 commits into
mainfrom
tasks/task-30-launchd-services

Conversation

@daemorgue

Copy link
Copy Markdown
Owner

The board and map services only existed as systemd user units, so a
Mac got a warning instead of a running board. The developer's new
MacBook is the first macOS machine daeshift runs on.

Install now renders user LaunchAgents from services/launchd/ on
Darwin, with the same planning, checks, marker and removal as on
Linux. Agents are loaded with launchctl bootstrap into the user's gui
domain, start at login, restart five seconds after a failure, and are
booted out and deleted when config.yaml no longer asks for them.
Paths are XML-escaped, and an agent that stays loaded after a bootout
fails the install with the command to run by hand. Nothing changes on
Linux; the warning on a machine with neither service manager now
names both.

How to see it: on a Mac, add a board or map port under projects: in
~/.daeshift/local/config.yaml and run daeshift --install; the service
answers on 127.0.0.1 and survives a reboot once you log in.

Risks: launchd behavior is stubbed in the tests; the real bootstrap
path is checked by hand on this Mac after the release.

The board and map services only existed as systemd user units, so a
Mac got a warning instead of a running board. Install now renders user
LaunchAgents from services/launchd/ on Darwin, with the same planning,
checks, marker and removal as on Linux: agents are loaded with
launchctl bootstrap into the user's gui domain, start at login and are
booted out and deleted when config.yaml no longer asks for them.
Nothing changes on Linux.
A fresh review found the plist comment held '--', which XML forbids in
comments, paths went into the XML unescaped, and a failed unload was
reported as removed. The marker now reads 'daeshift install', paths are
XML-escaped, and an agent that stays loaded after bootout fails the
install with the command to run. KeepAlive now restarts only after a
failure, five seconds apart, matching the systemd units. Tests assert
the bootstrap calls.
@daemorgue
daemorgue merged commit 485f8a5 into main Nov 21, 2026
10 checks passed
@daemorgue
daemorgue deleted the tasks/task-30-launchd-services branch November 21, 2026 16:12
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