From db0f2ce94be4e5cd45e199beb0abefae17cbed2a Mon Sep 17 00:00:00 2001 From: Greg Pstrucha <875316+Gricha@users.noreply.github.com> Date: Thu, 22 Jan 2026 05:35:10 +0000 Subject: [PATCH 1/2] fix: daemon mode not starting properly via systemctl - Add SHELL=/bin/bash fallback for terminals (systemd doesn't set SHELL) - Auto-start service after `perry agent install` instead of requiring manual start - Add SHELL env var to systemd service file --- src/agent/run.ts | 2 +- src/agent/systemd.ts | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/agent/run.ts b/src/agent/run.ts index 42cb50cc..1056d0b5 100644 --- a/src/agent/run.ts +++ b/src/agent/run.ts @@ -75,7 +75,7 @@ function createAgentServer( }; const getPreferredShell = () => { - return currentConfig.terminal?.preferredShell || process.env.SHELL; + return currentConfig.terminal?.preferredShell || process.env.SHELL || '/bin/bash'; }; const terminalHandler = new TerminalHandler({ diff --git a/src/agent/systemd.ts b/src/agent/systemd.ts index d767c343..16926e4c 100644 --- a/src/agent/systemd.ts +++ b/src/agent/systemd.ts @@ -33,6 +33,7 @@ export function generateServiceFile(options: InstallOptions = {}): string { `Environment=PERRY_PORT=${port}`, `Environment=PERRY_CONFIG_DIR=${configDir}`, `Environment=NODE_ENV=production`, + `Environment=SHELL=/bin/bash`, ]; if (options.noHostAccess) { @@ -126,9 +127,27 @@ export async function installService(options: InstallOptions = {}): Promise Date: Thu, 22 Jan 2026 05:39:52 +0000 Subject: [PATCH 2/2] fix: use restart instead of start to apply new config --- src/agent/systemd.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent/systemd.ts b/src/agent/systemd.ts index 16926e4c..88c599a5 100644 --- a/src/agent/systemd.ts +++ b/src/agent/systemd.ts @@ -128,7 +128,7 @@ export async function installService(options: InstallOptions = {}): Promise