mirror of
https://github.com/LearningCircuit/local-deep-research.git
synced 2026-06-16 03:51:07 +03:00
- Creates scripts/dev/stop_server.sh to complement restart_server.sh - Gracefully stops the LDR server process - Includes force stop fallback if processes don't terminate cleanly - Cleans up any orphaned Flask dev server processes - Provides clear status messages and exit codes
36 lines
1021 B
Bash
Executable File
36 lines
1021 B
Bash
Executable File
#!/bin/bash
|
|
# Script to stop the LDR server
|
|
|
|
echo "Stopping LDR server..."
|
|
|
|
# Kill the main server process
|
|
if pkill -f "python -m local_deep_research.web.app" 2>/dev/null; then
|
|
echo "✓ Server stopped successfully"
|
|
|
|
# Wait a moment for the process to fully terminate
|
|
sleep 1
|
|
|
|
# Check if any processes are still running
|
|
if pgrep -f "python -m local_deep_research.web.app" > /dev/null; then
|
|
echo "Warning: Some server processes may still be running"
|
|
echo "Attempting force stop..."
|
|
pkill -9 -f "python -m local_deep_research.web.app" 2>/dev/null
|
|
sleep 1
|
|
fi
|
|
else
|
|
echo "No running LDR server found"
|
|
fi
|
|
|
|
# Also stop any orphaned Flask dev servers
|
|
pkill -f "flask run" 2>/dev/null
|
|
|
|
# Check final status
|
|
if pgrep -f "python -m local_deep_research.web.app" > /dev/null; then
|
|
echo "Error: Server processes still running:"
|
|
ps aux | grep "python -m local_deep_research.web.app" | grep -v grep
|
|
exit 1
|
|
else
|
|
echo "All server processes stopped"
|
|
exit 0
|
|
fi
|