Commit e0682dd
committed
feat(fleet): install-service — user LaunchAgent for start-on-login on macOS
New `install-service` / `uninstall-service` subcommands render a
LaunchAgent plist against the invoking binary path and the agent's
data-dir log path, write it to `~/Library/LaunchAgents/`, and drive
`launchctl bootstrap` / `bootout`. No sudo, no static plist file to
ship, no manual `launchctl` steps for the operator.
The plist runs `arcbox-fleet-agent serve` at login (RunAtLoad),
respawns only on non-zero exit (KeepAlive.SuccessfulExit=false — a
`launchctl bootout` SIGTERM lets the agent drain runners and exit
cleanly without getting resurrected), and tees launchd's own
stdout/stderr into the same log dir the agent's logger uses so
early-startup output before `arcbox_logging::init` still lands next
to the real logs.
Uninstall is idempotent — a `bootout` with the job not loaded and a
missing plist file both count as success, since the desired end
state is "not installed."
macOS-only for this cut. Linux systemd (user unit) is the natural
follow-up; the CLI shape stays uniform (subcommand exists everywhere,
bails with a clear message on non-macOS) so docs and completions
don't diverge.1 parent 3c61b1c commit e0682dd
4 files changed
Lines changed: 313 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
128 | 140 | | |
129 | 141 | | |
130 | 142 | | |
| |||
444 | 456 | | |
445 | 457 | | |
446 | 458 | | |
| 459 | + | |
| 460 | + | |
447 | 461 | | |
448 | 462 | | |
449 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
450 | 494 | | |
451 | 495 | | |
452 | 496 | | |
| |||
0 commit comments