import { type ServiceScope } from "./service-definition.js"; import type { ServiceHost } from "./service-host.js"; import type { ServicePlatform, ServicePlatformState } from "./service-platform.js"; export interface SystemdServicePlatformOptions { /** 仅接收已检查的 /sys/fs/cgroup/.../cgroup.events,测试替换不扩大生产读取权限。 */ readFile?(file: string): Promise; now?(): number; sleep?(milliseconds: number): Promise; stopTimeoutMs?: number; /** 优雅停止超期后,对已验证固定 unit 的 cgroup 执行一次兜底强制终止。 */ forceKillAfterMs?: number; /** 仅用于测试替换;生产实现持有已验证 cgroup v2 的 cgroup.kill 文件句柄。 */ openCgroupKill?(file: string): Promise; } interface CgroupKillHandle { kill(): Promise; close(): Promise; } /** 调用者持有服务锁;这里既不写定义,也不尝试用未知状态恢复服务。 */ export declare class SystemdServicePlatform implements ServicePlatform { private readonly host; private readonly scope; private readonly expectedDefinitionPath; private readonly readFile; private readonly openCgroupKill; private readonly now; private readonly sleep; private readonly timeout; private readonly forceKillAfter; constructor(host: ServiceHost, scope: ServiceScope, expectedDefinitionPath: string, options?: SystemdServicePlatformOptions); private command; private show; inspect(): Promise; private inspectWithin; private inspectDetailedWithin; private stable; private stableInstance; quiesce(): Promise; reload(enabled: boolean): Promise; start(expectedInitialState?: ServicePlatformState): Promise; } export {}; //# sourceMappingURL=service-platform-systemd.d.ts.map