MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / handleDaemonStop

Function handleDaemonStop

src/daemon/main.ts:169–190  ·  view source on GitHub ↗

* Stop a running daemon from another CLI process.

()

Source from the content-addressed store, hash-verified

167 * Stop a running daemon from another CLI process.
168 */
169async function handleDaemonStop(): Promise<void> {
170 const result = queryDaemonStatus()
171
172 if (result.status === 'stopped') {
173 console.log('daemon is not running')
174 return
175 }
176
177 if (result.status === 'stale') {
178 console.log('daemon was stale (cleaned up)')
179 return
180 }
181
182 console.log(`stopping daemon (PID: ${result.state!.pid})...`)
183 const stopped = await stopDaemonByPid()
184
185 if (stopped) {
186 console.log('daemon stopped')
187 } else {
188 console.log('daemon could not be stopped (may have already exited)')
189 }
190}
191
192/**
193 * Parse supervisor arguments from CLI.

Callers 1

daemonMainFunction · 0.85

Calls 2

queryDaemonStatusFunction · 0.85
stopDaemonByPidFunction · 0.85

Tested by

no test coverage detected