MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / start

Function start

packages/server/src/svc/systemd.ts:116–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114 }
115
116 async function start(): Promise<LifecycleResult> {
117 if (!existsSync(deps.unitPath())) {
118 return {
119 ok: false,
120 message: 'systemd unit is not installed. Run `kimi server install` first.',
121 };
122 }
123 const result = await deps.execSystemctl(['start', KIMI_SERVER_SYSTEMD_UNIT]);
124 if (result.code !== 0) {
125 return {
126 ok: false,
127 message: `systemctl --user start failed: ${detail(result) ?? 'unknown error'}`,
128 };
129 }
130 return { ok: true, message: `Kimi server started (${KIMI_SERVER_SYSTEMD_UNIT}).` };
131 }
132
133 async function stop(): Promise<LifecycleResult> {
134 const result = await deps.execSystemctl(['stop', KIMI_SERVER_SYSTEMD_UNIT]);

Callers

nothing calls this directly

Calls 3

unitPathMethod · 0.80
execSystemctlMethod · 0.80
detailFunction · 0.70

Tested by

no test coverage detected