From 61df8e6f022ddd161e71a3690a1453f44e10c1d1 Mon Sep 17 00:00:00 2001 From: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com> Date: Sun, 17 May 2026 11:55:20 +0200 Subject: [PATCH] fix(updatenotification): preserve start mode on restart Use current process arguments when spawning the restart command so auto-restart keeps the active runtime mode (for example start:x11) instead of always defaulting to start. Refs #4154 --- defaultmodules/updatenotification/update_helper.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/defaultmodules/updatenotification/update_helper.js b/defaultmodules/updatenotification/update_helper.js index 721f295854..dd92c4ffe1 100644 --- a/defaultmodules/updatenotification/update_helper.js +++ b/defaultmodules/updatenotification/update_helper.js @@ -130,12 +130,15 @@ class Updater { }); } - // restart MagicMirror with "node --run start" + // restart MagicMirror with the same start command as the current process nodeRestart () { Log.info("Restarting MagicMirror..."); const out = process.stdout; const err = process.stderr; - const subprocess = Spawn("node --run start", { cwd: this.root_path, shell: true, detached: true, stdio: ["ignore", out, err] }); + + // Get the current process command line + const currentCommand = process.argv.slice(1).join(" "); + const subprocess = Spawn(`node ${currentCommand}`, { cwd: this.root_path, shell: true, detached: true, stdio: ["ignore", out, err] }); subprocess.unref(); // detach the newly launched process from the master process process.exit(); }