MCPcopy Create free account
hub / github.com/compozy/agh / stopDaemonForUninstall

Function stopDaemonForUninstall

internal/cli/lifecycle.go:196–214  ·  view source on GitHub ↗
(ctx context.Context, deps commandDeps, runtime *runtimeContext)

Source from the content-addressed store, hash-verified

194}
195
196func stopDaemonForUninstall(ctx context.Context, deps commandDeps, runtime *runtimeContext) (bool, error) {
197 info, running, err := daemonInfo(runtime.HomePaths, deps)
198 if err != nil {
199 return false, err
200 }
201 if !running {
202 return false, nil
203 }
204 if err := deps.signalProcess(info.PID, syscall.SIGTERM); err != nil {
205 if errors.Is(err, os.ErrProcessDone) || errors.Is(err, syscall.ESRCH) {
206 return true, nil
207 }
208 return false, fmt.Errorf("cli: stop daemon for uninstall: %w", err)
209 }
210 if _, err := waitForDaemonStop(ctx, deps, runtime, info); err != nil {
211 return false, err
212 }
213 return true, nil
214}
215
216func removeRuntimeArtifacts(homePaths aghconfig.HomePaths) ([]string, error) {
217 candidates := []string{

Callers 1

newUninstallCommandFunction · 0.85

Calls 4

daemonInfoFunction · 0.85
waitForDaemonStopFunction · 0.85
signalProcessMethod · 0.80
IsMethod · 0.45

Tested by

no test coverage detected