fix: honor gateway service override labels

This commit is contained in:
Peter Steinberger
2026-01-13 05:58:46 +00:00
parent 42ff634a9d
commit 5918def440
16 changed files with 128 additions and 35 deletions

View File

@@ -45,14 +45,19 @@ export type GatewayService = {
stdout: NodeJS.WritableStream;
}) => Promise<void>;
stop: (args: {
env?: Record<string, string | undefined>;
profile?: string;
stdout: NodeJS.WritableStream;
}) => Promise<void>;
restart: (args: {
env?: Record<string, string | undefined>;
profile?: string;
stdout: NodeJS.WritableStream;
}) => Promise<void>;
isLoaded: (args: { profile?: string }) => Promise<boolean>;
isLoaded: (args: {
env?: Record<string, string | undefined>;
profile?: string;
}) => Promise<boolean>;
readCommand: (env: Record<string, string | undefined>) => Promise<{
programArguments: string[];
workingDirectory?: string;
@@ -77,15 +82,21 @@ export function resolveGatewayService(): GatewayService {
await uninstallLaunchAgent(args);
},
stop: async (args) => {
await stopLaunchAgent({ stdout: args.stdout, profile: args.profile });
await stopLaunchAgent({
stdout: args.stdout,
profile: args.profile,
env: args.env,
});
},
restart: async (args) => {
await restartLaunchAgent({
stdout: args.stdout,
profile: args.profile,
env: args.env,
});
},
isLoaded: async (args) => isLaunchAgentLoaded(args.profile),
isLoaded: async (args) =>
isLaunchAgentLoaded({ profile: args.profile, env: args.env }),
readCommand: readLaunchAgentProgramArguments,
readRuntime: readLaunchAgentRuntime,
};
@@ -106,15 +117,18 @@ export function resolveGatewayService(): GatewayService {
await stopSystemdService({
stdout: args.stdout,
profile: args.profile,
env: args.env,
});
},
restart: async (args) => {
await restartSystemdService({
stdout: args.stdout,
profile: args.profile,
env: args.env,
});
},
isLoaded: async (args) => isSystemdServiceEnabled(args.profile),
isLoaded: async (args) =>
isSystemdServiceEnabled({ profile: args.profile, env: args.env }),
readCommand: readSystemdServiceExecStart,
readRuntime: async (env) => await readSystemdServiceRuntime(env),
};
@@ -132,7 +146,10 @@ export function resolveGatewayService(): GatewayService {
await uninstallScheduledTask(args);
},
stop: async (args) => {
await stopScheduledTask({ stdout: args.stdout, profile: args.profile });
await stopScheduledTask({
stdout: args.stdout,
profile: args.profile,
});
},
restart: async (args) => {
await restartScheduledTask({