mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 17:10:20 +00:00
refactor: consolidate daemon runtime and start hints
This commit is contained in:
@@ -4,8 +4,8 @@ import {
|
||||
resolveGatewaySystemdServiceName,
|
||||
resolveGatewayWindowsTaskName,
|
||||
} from "../daemon/constants.js";
|
||||
import { resolveGatewayLogPaths } from "../daemon/launchd.js";
|
||||
import { formatRuntimeStatus } from "../daemon/runtime-format.js";
|
||||
import { buildPlatformRuntimeLogHints } from "../daemon/runtime-hints.js";
|
||||
import type { GatewayServiceRuntime } from "../daemon/service-runtime.js";
|
||||
import {
|
||||
isSystemdUnavailableDetail,
|
||||
@@ -68,17 +68,14 @@ export function buildGatewayRuntimeHints(
|
||||
if (fileLog) {
|
||||
hints.push(`File logs: ${fileLog}`);
|
||||
}
|
||||
if (platform === "darwin") {
|
||||
const logs = resolveGatewayLogPaths(env);
|
||||
hints.push(`Launchd stdout (if installed): ${logs.stdoutPath}`);
|
||||
hints.push(`Launchd stderr (if installed): ${logs.stderrPath}`);
|
||||
} else if (platform === "linux") {
|
||||
const unit = resolveGatewaySystemdServiceName(env.OPENCLAW_PROFILE);
|
||||
hints.push(`Logs: journalctl --user -u ${unit}.service -n 200 --no-pager`);
|
||||
} else if (platform === "win32") {
|
||||
const task = resolveGatewayWindowsTaskName(env.OPENCLAW_PROFILE);
|
||||
hints.push(`Logs: schtasks /Query /TN "${task}" /V /FO LIST`);
|
||||
}
|
||||
hints.push(
|
||||
...buildPlatformRuntimeLogHints({
|
||||
platform,
|
||||
env,
|
||||
systemdServiceName: resolveGatewaySystemdServiceName(env.OPENCLAW_PROFILE),
|
||||
windowsTaskName: resolveGatewayWindowsTaskName(env.OPENCLAW_PROFILE),
|
||||
}),
|
||||
);
|
||||
}
|
||||
return hints;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user