Unitech / Unitech/pm2

PM2 don't restart automaticaly after system reboot

Open
#5,297 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

Hey there!

I'm really embarrassed with this problem: pm2 don't restart after a system crash (or just a simple system reboot).

I had read the documentation and maked the stratup strategy like that:

  1. Add my NodeJS conf into ecosystem file
  2. Start this ecosystem file with pm2
  3. Generate a startup script with pm2 startup
  4. Copy/paste the command to add the script on systemd
  5. Save the state with pm2 save
  6. Try a reboot and see that pm2 is not up after reboot

If i do a systemctl status , i see the error bellow:
image

But, if i do manually pm2 resurrect, pm2 start and my app is alive. .

Thank's a lot for your help!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the pm2 startup and pm2 save flow, then inspect the generated systemd service using systemctl status and compare it with manually running pm2 resurrect. Reproduce the reboot scenario and verify that the saved ecosystem starts automatically and the application is alive afterward.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.