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

Function uninstall

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

Source from the content-addressed store, hash-verified

95 }
96
97 async function uninstall(): Promise<LifecycleResult> {
98 const unitPath = deps.unitPath();
99 if (!existsSync(unitPath)) {
100 deleteInstallPlan();
101 return { ok: true, message: 'systemd unit was not installed; nothing to remove.' };
102 }
103 await deps.execSystemctl(['disable', '--now', KIMI_SERVER_SYSTEMD_UNIT]).catch(() => undefined);
104 try {
105 rmSync(unitPath, { force: true });
106 } catch (error) {
107 throw new Error(
108 `failed to remove unit ${unitPath}: ${error instanceof Error ? error.message : String(error)}`,
109 );
110 }
111 await deps.execSystemctl(['daemon-reload']).catch(() => undefined);
112 deleteInstallPlan();
113 return { ok: true, message: `systemd unit removed (${unitPath}).` };
114 }
115
116 async function start(): Promise<LifecycleResult> {
117 if (!existsSync(deps.unitPath())) {

Callers

nothing calls this directly

Calls 3

deleteInstallPlanFunction · 0.90
unitPathMethod · 0.80
execSystemctlMethod · 0.80

Tested by

no test coverage detected