fix: add gateway stop/restart commands

This commit is contained in:
Peter Steinberger committed 2026-01-06 03:25:32 +01:00
1 parent cc0ef4d012
commit 0398f684e7
18 files changed
+339 -28

No files matched your search

+16
View File
@@ -331,6 +331,22 @@ export async function uninstallSystemdService({
}
}
export async function stopSystemdService({
stdout,
}: {
stdout: NodeJS.WritableStream;
}): Promise<void> {
await assertSystemdAvailable();
const unitName = `${GATEWAY_SYSTEMD_SERVICE_NAME}.service`;
const res = await execSystemctl(["--user", "stop", unitName]);
if (res.code !== 0) {
throw new Error(
`systemctl stop failed: ${res.stderr || res.stdout}`.trim(),
);
}
stdout.write(`Stopped systemd service: ${unitName}\n`);
}
export async function restartSystemdService({
stdout,
}: {