feat: expand daemon status diagnostics

This commit is contained in:
Peter Steinberger
2026-01-08 08:24:28 +01:00
parent 15dd6b65b6
commit a676e16fbb
7 changed files with 208 additions and 16 deletions

View File

@@ -50,6 +50,10 @@ function parseLsofFieldOutput(output: string): PortListener[] {
current = Number.isFinite(pid) ? { pid } : {};
} else if (line.startsWith("c")) {
current.command = line.slice(1);
} else if (line.startsWith("n")) {
// TCP 127.0.0.1:18789 (LISTEN)
// TCP *:18789 (LISTEN)
if (!current.address) current.address = line.slice(1);
}
}
if (current.pid || current.command) listeners.push(current);
@@ -81,7 +85,7 @@ async function readUnixListeners(
"-nP",
`-iTCP:${port}`,
"-sTCP:LISTEN",
"-FpFc",
"-FpFcn",
]);
if (res.code === 0) {
const listeners = parseLsofFieldOutput(res.stdout);