Skip to content

Commit 0d2ab1b

Browse files
julianknutsenclaude
andcommitted
fix: always regenerate service file on gc start
Previously the plist/systemd unit was only written if missing. After a brew upgrade the old plist (without PATH) would persist, so launchd could not find Homebrew-installed deps like dolt. Now gc start always regenerates the service file, picking up template changes like PATH. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 790ca7c commit 0d2ab1b

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

cmd/gc/cmd_supervisor_lifecycle.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,18 @@ func doSupervisorStart(stdout, stderr io.Writer) int {
9797
}
9898

9999
func ensureSupervisorRunning(stdout, stderr io.Writer) int {
100+
// Always regenerate the service file so upgrades pick up template
101+
// changes (e.g. PATH captured from the user's shell).
102+
if doSupervisorInstall(stdout, stderr) != 0 {
103+
if supervisorAlive() != 0 {
104+
return 0
105+
}
106+
// Fall back to bare start if install fails (e.g., unsupported OS).
107+
return doSupervisorStart(stdout, stderr)
108+
}
100109
if supervisorAlive() != 0 {
101110
return 0
102111
}
103-
// Auto-install platform service if not yet registered.
104-
if !isSupervisorServiceInstalled() {
105-
if doSupervisorInstall(stdout, stderr) != 0 {
106-
// Fall back to bare start if install fails (e.g., unsupported OS).
107-
return doSupervisorStart(stdout, stderr)
108-
}
109-
// doSupervisorInstall already loads/starts the service.
110-
return waitForSupervisorReady(stderr)
111-
}
112-
// Service is installed but not running — kick it.
113-
startInstalledService(stderr)
114112
return waitForSupervisorReady(stderr)
115113
}
116114

0 commit comments

Comments
 (0)