feat(desktop): auto-restart desktop-managed daemon on version mismatch
When the desktop app starts and finds a running daemon with a different version, it now restarts it automatically. Only applies to daemons the desktop app itself started, identified by a PASEO_DESKTOP_MANAGED flag written into the PID lock file. Also rewrites resolveStatus() to use the CLI daemon status command instead of manually parsing the PID file, and surfaces daemonVersion in the CLI status output from the WebSocket hello message.
This commit is contained in:
@@ -9,6 +9,7 @@ export interface PidLockInfo {
|
||||
hostname: string;
|
||||
uid: number;
|
||||
listen: string | null;
|
||||
desktopManaged?: boolean;
|
||||
}
|
||||
|
||||
export class PidLockError extends Error {
|
||||
@@ -86,6 +87,7 @@ export async function acquirePidLock(
|
||||
hostname: hostname(),
|
||||
uid: process.getuid?.() ?? 0,
|
||||
listen,
|
||||
...(process.env.PASEO_DESKTOP_MANAGED === "1" ? { desktopManaged: true } : {}),
|
||||
};
|
||||
|
||||
let fd;
|
||||
|
||||
Reference in New Issue
Block a user