-
Notifications
You must be signed in to change notification settings - Fork 0
Process Management
JumpStart Wiki Bot edited this page Aug 8, 2026
·
1 revision
Package: internal/procman.
- Start/stop commands in an isolated process group
- Ring-buffer logs
- Discover listening ports (log scrape + OS poll)
- Emit
log:,ports:,exit:events through the injectedEmitter
- If the same ID exists and is still running → error.
- If it exited but a child may hold the port →
killTreebefore restart. - Command runs via platform shell helper (
shellCommand). - Env = resolved process environment + per-process
Envmap. - Goroutines: stdout pipe, stderr pipe, port poll (≈15 × 2s), wait for exit.
- Signal the process group (Unix: SIGTERM then SIGKILL after grace; Windows: job/tree kill).
- App marks intentional stops in
stoppingso non-zero exits are not reported asprocess_crashed. - App shutdown sets
shuttingDownand stops everything.
- From log lines (
portsFromLine) andportsForGroup/lsof-style helpers (ports_unix.go/ports_windows.go). - Aggregated in UI via
GetPortMapand per-card badges (openhttp://localhost:<port>).
- In-memory
logBufper process;GetLogsreturns a snapshot; live lines via events. - Scanner allows large lines (up to 1MB buffer).
| File | Role |
|---|---|
proc_unix.go / proc_windows.go
|
Process group + kill |
env_unix.go / env_windows.go
|
Base environment |
ports_unix.go / ports_windows.go
|
Port enumeration |
ports.go |
Shared parsing / merge |
logbuf.go |
Log ring buffer |
manager.go |
Orchestration |
Scripts, tests, and deps-install reuse the same manager + event names with synthetic IDs so LogPanel / EventsOn('exit:…') work unchanged.
- Never start long-lived work outside procman if the UI expects logs/ports.
- Always use stable IDs; regenerating IDs breaks event subscriptions.
- Compose processes may be hidden from the Processes tab — check
frontend/src/procUtils.js. - Closing the app always stops managed processes (by design).