Skip to content

fix: verify server actually stopped in stop-server.sh#751

Merged
obra merged 1 commit intoobra:mainfrom
savvyinsight:fix/stop-server-verify
Mar 17, 2026
Merged

fix: verify server actually stopped in stop-server.sh#751
obra merged 1 commit intoobra:mainfrom
savvyinsight:fix/stop-server-verify

Conversation

@savvyinsight
Copy link
Contributor

Fix [stop-server.sh] so it doesn’t report success unless the server process is actually dead (SIGTERM + wait + SIGKILL fallback).

Motivation and Context

[stop-server.sh] previously always returned {"status":"stopped"} after sending SIGTERM, even if the node server kept listening on the port. That made the “stop” command misleading and prevents safe automation or retries (because the PID file was removed even if the process survived).

How Has This Been Tested?

Started the visual companion server (start-server.sh)
Ran stop-server.sh <screen_dir>
Confirmed output is "stopped" only when the process truly exited
Verified with lsof -i : that the server stopped
Confirmed it reports "failed" when the process ignores SIGTERM/SIGKILL

Breaking Changes

No. This is a bug fix and does not change existing behavior except making the stop result accurate.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

This directly addresses issue #729

@obra obra merged commit bd537d8 into obra:main Mar 17, 2026
obra added a commit that referenced this pull request Mar 17, 2026
…ify"

This reverts commit bd537d8, reversing
changes made to 363923f.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants