update.Relaunch left the shell that waits for magpie to exit and then
runs `open` in magpie's own process group. launchd ends a job's process
group when its process exits, so the shell died with magpie and the new
version never opened. ee16c657 fixed this for the Open at login agent
only (AbandonProcessGroup in the plist magpie writes). The job
LaunchServices makes for an app opened from the Dock or Finder carries
no such key, and on the reporter's macOS 13 (Intel, 0.1.1250) the
restart quit and nothing came back until a manual launch. The shell now
starts in a session of its own (detach, as RelaunchBinary's helper on
Windows and Linux already does). That holds for both job kinds, however
the previous version was started.
Tried on this Mac (macOS 26.2) with throwaway jobs, all removed after:
- A LaunchAgent without AbandonProcessGroup (a Go parent starting the
same wait-then-run shell, then exiting): the shell in the parent's
group never ran; one with Setsid did.
- A Cocoa .app opened with `open`, relaunching itself through the same
shell: macOS 26 didn't kill the group, and both inherit and setsid
relaunched. The application-job half is the reporter's macOS 13
observation (their isolated A/B matches the agent case above). It
was not reproduced on this OS.
- A setsid shell's `open` relaunched the .app fine (open rc 0, new pid).
Not tried: a real magpie update on macOS 13. No such machine here.
Siblings: RelaunchBinary (Windows, Linux) already detaches its child
through launch. Reexec (magpie web) runs in place. No other code
waits for magpie's pid and then opens it.
Tested: TestRelaunchOutlivesItsJobsGroup. A child of the test leads a
process group as a job's process does, starts the helper through
runAfterExit and exits. The test then kills the group as launchd does,
and the helper must still run its command. With detach(cmd) removed it
fails: "the relaunch helper died with the job's process group: the new
version was never opened" (15s). Restored, it passes (1.06s, 3 of 3).
go test -tags nogui -p 1 ./internal/update ok. gofmt -l clean. go vet
-tags nogui (darwin, GOOS=linux) and GOOS=windows go vet on
./internal/update ok.
Full suite: SUITE_LINE