-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstop_all.bat
More file actions
59 lines (49 loc) · 1.8 KB
/
stop_all.bat
File metadata and controls
59 lines (49 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@echo off
REM IoT System - Stop All Services
REM This script uses port_manager.py to stop all running services
echo ================================================
echo IoT Microservices System - Stopping All Services
echo ================================================
echo.
REM Check if virtual environment exists
if not exist venv (
echo ERROR: Virtual environment not found!
echo Please run setup.bat first to create the virtual environment.
pause
exit /b 1
)
REM Activate virtual environment
call venv\Scripts\activate.bat
echo Using port_manager.py to stop all services...
echo.
REM Use port_manager to stop all services
python port_manager.py stop --all
if %errorlevel% neq 0 (
echo.
echo WARNING: Some services may not have stopped cleanly.
echo Trying alternative method using taskkill...
echo.
REM Fallback: Kill Python processes running our services
echo Stopping Python service processes...
taskkill /F /FI "WINDOWTITLE eq IoT -*" 2>nul
REM Kill specific Python processes by command line pattern
for %%s in (catalog message_broker raspberrypi timeSeriesDbConnector analytics account_manager control_center telegram_bot web_dashboard) do (
echo Checking for %%s...
wmic process where "commandline like '%%python%%' and commandline like '%%\\%%s\\%%'" delete 2>nul
)
)
echo.
echo ================================================
echo Services stopped!
echo ================================================
echo.
echo Verifying service status...
python port_manager.py status
echo.
echo All terminal windows should now be closed.
echo If any services are still running, you can:
echo 1. Close their terminal windows manually
echo 2. Use Task Manager to end Python processes
echo 3. Use: python port_manager.py kill --port [PORT_NUMBER]
echo.
pause