windows-local-service-ops
Windows service ops: port zombies, env pollution, health.
- License 许可
- MIT
- 所属仓库
- zapabob/Skills
- 最近更新
- 2026-10-26
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- windows-local-service-ops
- author
- Hermes Agent
- license
- MIT
- version
- 0.1.0
- metadata
- { "hermes": { "tags": [ "windows", "service", "ops", "port", "zombie", "restart", "irodori", "line-bridge" ], "related_skills": [ "line-personal-bridge", "irodori-tts-windows-startup", "hermes-gateway-operations" ] } }
- description
- Windows service ops: port zombies, env pollution, health.
03 SKILL.md 正文
Windows Local Service Ops
When to Use
- A local background service on this Windows box is down, crash-looping, or failing health checks
- The daily audit flags a service failure (LINE bridge, irodori-TTS, llama)
listen EADDRINUSEappears repeatedly in a service log- Launching a venv server from the Hermes shell and it crashes on import
Covers port-zombie recovery, MSYS/git-bash quirks, venv env pollution, and the launch → health-check pattern. The canonical per-service skills (irodori-tts-windows-startup, line-personal-bridge) live in the DEFAULT profile (~/.hermes/skills/) — read them for service internals; this skill is the generic recovery playbook that works from any profile.
Service inventory (this box)
| Service | Port | Health probe | Launcher |
|---|---|---|---|
| Irodori-TTS | 8088 | GET /health | .venv/Scripts/python.exe -m irodori_openai_tts (server repo) |
| Personal LINE bridge worker | 9101 | GET /status | start_personal_line_bridge.py supervisor |
| Personal LINE reply server | 9102 | GET /health | same supervisor |
| Local llama server | 8080 | GET /v1/models | SuperGemma4-LlamaServer.vbs (Startup) |
Port zombie recovery (EADDRINUSE crash loop)
Symptom: a service crash-loops with listen EADDRINUSE: address already in use 127.0.0.1:<port> (e.g. every 5 min in its log), or a watchdog keeps failing to bind.
- Find the holder:
netstat -ano | grep <port> | grep LISTEN→ PID. - Identify it before killing:
wmic process where "ProcessId=<PID>" get Name,CommandLine. - Kill it — git-bash mangles Windows flags: plain
taskkill //F //PID <PID>fails with "Invalid argument/option". Use:MSYS_NO_PATHCONV=1 taskkill /F /PID <PID> - Confirm the port is free (TIME_WAIT remnants are harmless).
- Restart via the service's normal launcher, then health-check.
Launching venv servers from the Hermes shell
- Never use nohup/& wrappers — Hermes rejects them. Launch with
terminal(command=..., background=true), then probe health in a separate call after a short wait (model servers take ~20-30s). - Python environment pollution pitfall — an inherited
PYTHONPATHcan make a server venv import another interpreter's packages, producingModuleNotFoundError: No module named 'pydantic_core._pydantic_core'even when the server's own dependencies are intact. Compare package origins under inherited and isolated environments before reinstalling anything. For a module installed in its own venv, launch.venv/Scripts/python.exe -I -m <server_module>: isolated mode ignoresPYTHONPATH,PYTHONHOME, and user-site packages without mutating the parent. Irodori's shared PowerShell launcher uses this boundary. For source-only applications that requirePYTHONPATH, explicitly construct the child environment rather than removing the parent's settings globally. Verify child package origins, health, and an actual request. - Use the venv's own interpreter (
.venv/Scripts/python.exe); barepythonon this box is the MS Store stub — usepython3.12for ad-hoc scripts. - Always health-check after launch: curl the health endpoint AND confirm a LISTEN line on the port.
Pitfalls
- Detached Windows children can hold captured pipes open:
subprocess.run(capture_output=True)may wait for EOF after PowerShell has exited ifStart-Processpasses inherited handles to a persistent server. Even timeout cleanup can block insidecommunicate(). Confirm that the script exited and that the requested artifact was actually written before blaming slow inference. Capture wrapper stdout/stderr withtempfile.TemporaryFile()handles and decode them after the wrapper exits. Keep these handles outside the inputTemporaryDirectory: ordinary named files in that directory may remain locked by the server and causeWinError 32during cleanup. A live regression should prove that the wrapper returns while the server still answers health. The test driver must use boundedPopen.wait()and clean up only its own synthetic server. - A crash-loop with EADDRINUSE is almost always a zombie process holding the port; killing the holder fixes the loop — do not chase the crash itself.
- MSYS rewrites
/c/...-style args too; prefixMSYS_NO_PATHCONV=1for any Windows-native flag/arg that must pass through verbatim. skill_viewcan't see default-profile skills from the secretary profile; read them via read_file at%USERPROFILE%\.hermes\skills\...when needed.
Verified recipes
references/line-personal-bridge-recovery.md— EADDRINUSE loop + QR re-link workflow.references/irodori-launch-cpu.md— PYTHONPATH-crash fix and verified CPU launch.
04 同仓库更多 Skills
xurl
X/Twitter via xurl CLI: post, search, DM, media, v2 API.
writing-plans
Write implementation plans: bite-sized tasks, paths, code.
whisper
OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.
weights-and-biases
W&B: log ML experiments, sweeps, model registry, dashboards.
watchers
Poll RSS, JSON APIs, and GitHub with watermark dedup.
serving-llms-vllm
vLLM: high-throughput LLM serving, OpenAI API, quantization.