Fix setup: shell PATH, restart race, Tailscale wait, macOS 27 grants
This commit is contained in:
+8
-1
@@ -78,8 +78,15 @@ func installCmd() {
|
||||
return
|
||||
}
|
||||
// bootout kills every process the service started, which includes this one when an agent runs it.
|
||||
reload := exec.Command("/bin/sh", "-c", `launchctl bootout "$1"; launchctl bootstrap "$2" "$3"`, "sh", service, domain, plistPath)
|
||||
// It returns before the old server exits, and bootstrap fails while the job is still tearing down.
|
||||
reload := exec.Command("/bin/sh", "-c", `launchctl bootout "$1"; while launchctl print "$1" >/dev/null 2>&1; do sleep 1; done; launchctl bootstrap "$2" "$3"`, "sh", service, domain, plistPath)
|
||||
reload.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
|
||||
logFile, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0o644)
|
||||
if err != nil {
|
||||
fatal("open log", "err", err)
|
||||
}
|
||||
reload.Stdout = logFile
|
||||
reload.Stderr = logFile
|
||||
err = reload.Start()
|
||||
if err != nil {
|
||||
fatal("restart service", "err", err)
|
||||
|
||||
Reference in New Issue
Block a user