mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(update): re-enable launchd service before updater bootstrap
This commit is contained in:
@@ -98,7 +98,8 @@ describe("restart-helper", () => {
|
||||
expect(scriptPath.endsWith(".sh")).toBe(true);
|
||||
expect(content).toContain("#!/bin/sh");
|
||||
expect(content).toContain("launchctl kickstart -k 'gui/501/ai.openclaw.gateway'");
|
||||
// Should fall back to bootstrap when kickstart fails (service deregistered after bootout)
|
||||
// Should clear disabled state and fall back to bootstrap when kickstart fails.
|
||||
expect(content).toContain("launchctl enable 'gui/501/ai.openclaw.gateway'");
|
||||
expect(content).toContain("launchctl bootstrap 'gui/501'");
|
||||
expect(content).toContain('rm -f "$0"');
|
||||
await cleanupScript(scriptPath);
|
||||
|
||||
@@ -95,8 +95,10 @@ rm -f "$0"
|
||||
# Wait briefly to ensure file locks are released after update.
|
||||
sleep 1
|
||||
# Try kickstart first (works when the service is still registered).
|
||||
# If it fails (e.g. after bootout), re-register via bootstrap then kickstart.
|
||||
# If it fails (e.g. after bootout), clear any persisted disabled state,
|
||||
# then re-register via bootstrap and kickstart.
|
||||
if ! launchctl kickstart -k 'gui/${uid}/${escaped}' 2>/dev/null; then
|
||||
launchctl enable 'gui/${uid}/${escaped}' 2>/dev/null
|
||||
launchctl bootstrap 'gui/${uid}' '${escapedPlistPath}' 2>/dev/null
|
||||
launchctl kickstart -k 'gui/${uid}/${escaped}' 2>/dev/null || true
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user