Skip to content

fix(updatenotification): don't spawn a child process when running under PM2#4166

Merged
khassel merged 1 commit into
MagicMirrorOrg:developfrom
KristjanESPERANTO:pm2
May 21, 2026
Merged

fix(updatenotification): don't spawn a child process when running under PM2#4166
khassel merged 1 commit into
MagicMirrorOrg:developfrom
KristjanESPERANTO:pm2

Conversation

@KristjanESPERANTO
Copy link
Copy Markdown
Collaborator

Previously, nodeRestart() would spawn a detached child and exit. Under PM2 that's a problem: PM2 also respawns on exit, so both race to bind the same port.

The fix: When process.env.pm_id is set, just exit and let PM2 handle the restart.

The spawn logic is moved into its own method so it can be tested cleanly.

Partially fixes #4165

…er PM2

Previously, `nodeRestart()` would spawn a detached child and exit.
Under PM2 that's a problem: PM2 also respawns on exit, so both race
to bind the same port.

The fix: When `process.env.pm_id` is set, just exit and let PM2
handle the restart.

The spawn logic is moved into its own method so it can be tested cleanly.

Partially fixes MagicMirrorOrg#4165
@khassel khassel merged commit 03e4eef into MagicMirrorOrg:develop May 21, 2026
12 checks passed
@KristjanESPERANTO KristjanESPERANTO deleted the pm2 branch May 22, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants