diff --git a/skills/reflex-process-management/SKILL.md b/skills/reflex-process-management/SKILL.md index 3fa82f0..5423272 100644 --- a/skills/reflex-process-management/SKILL.md +++ b/skills/reflex-process-management/SKILL.md @@ -45,12 +45,14 @@ Read `reflex.log` to find the port the app is listening on. Look for a line like ### Step 2: Find the app process -Using the port from Step 1, locate the process: +Using the port from Step 1, locate the **listening** process (not browser connections): ```bash -lsof -i : -t +lsof -i : -sTCP:LISTEN -t ``` +The `-sTCP:LISTEN` flag is critical — it filters to only the server process that is *listening* on the port, excluding browser or client connections. Without it, you may kill the user's browser. + If `lsof` is not available, use: ```bash @@ -68,13 +70,13 @@ fuser /tcp Send `SIGINT` (equivalent to Ctrl+C) to gracefully stop the process: ```bash -kill -INT $(lsof -i : -t) +kill -INT $(lsof -i : -sTCP:LISTEN -t) ``` If the process doesn't stop, escalate to `SIGTERM`: ```bash -kill -TERM $(lsof -i : -t) +kill -TERM $(lsof -i : -sTCP:LISTEN -t) ``` ### Step 4: Restart the server