feat: expand daemon status diagnostics
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user