pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

reboot : always show Current process list is not synchronized with saved list. App nast differs. Type 'pm2 save' to synchronize.

Open alicera opened this issue 2 years ago • 8 comments

What's going wrong?

When I pm2 start app.js --name app and reboot , the app will disappear and show the message. Until I use pm2 resurrect, it will show the app

[PM2][WARN] Current process list is not synchronized with saved list. App nast differs. Type 'pm2 save' to synchronize.

How could we reproduce this issue?

https://sobus-piotr.medium.com/pm2-share-the-same-daemon-process-between-multiple-users-dd7ecae6197a

Supporting information

alicera avatar Oct 24 '22 01:10 alicera

The command pm2 save that I use

alicera avatar Oct 24 '22 01:10 alicera

I found I do that

it will generate three location /etc/pm2daemon/pm2.pid /etc/pm2daemon/.pm2/pm2.pid /home/aa/.pm2/pm2.pid

alicera avatar Oct 24 '22 02:10 alicera

Have you managed to fix this? Having the same issue, need to keep doing sudo pm2 resurrect after restart.

jpalo avatar Aug 25 '23 04:08 jpalo

if you are using debian 12 or any linux based on new systemd after run pm2 resurrect, you need to run pm2 startup.

Look the results:

pm2 startup [PM2] Init System found: systemd Platform systemd Template [Unit] Description=PM2 process manager Documentation=https://pm2.keymetrics.io/ After=network.target

[Service] Type=forking User=root LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity Environment=PATH=/root/.nvm/versions/node/v18.18.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin Environment=PM2_HOME=/root/.pm2 PIDFile=/root/.pm2/pm2.pid Restart=on-failure

ExecStart=/root/.nvm/versions/node/v18.18.2/lib/node_modules/pm2/bin/pm2 resurrect ExecReload=/root/.nvm/versions/node/v18.18.2/lib/node_modules/pm2/bin/pm2 reload all ExecStop=/root/.nvm/versions/node/v18.18.2/lib/node_modules/pm2/bin/pm2 kill

[Install] WantedBy=multi-user.target

Target path /etc/systemd/system/pm2-root.service Command list [ 'systemctl enable pm2-root' ] [PM2] Writing init configuration in /etc/systemd/system/pm2-root.service [PM2] Making script booting at startup... [PM2] [-] Executing: systemctl enable pm2-root... [PM2] [v] Command successfully executed. +---------------------------------------+ [PM2] Freeze a process list on reboot via: $ pm2 save

[PM2] Remove init script via: $ pm2 unstartup systemd

cassioseffrin avatar Oct 25 '23 18:10 cassioseffrin

Have you managed to fix this? Having the same issue, need to keep doing sudo pm2 resurrect after restart.

@jpalo Man, this command saved my life. Thanks a lot!

rafaelxavierborges avatar Feb 20 '24 15:02 rafaelxavierborges

Have you managed to fix this? Having the same issue, need to keep doing sudo pm2 resurrect after restart.

@jpalo Man, this command saved my life. Thanks a lot!

thanks for highlight saved my time

haidarabdillah avatar Apr 03 '24 10:04 haidarabdillah

Have you managed to fix this? Having the same issue, need to keep doing sudo pm2 resurrect after restart.

@jpalo Man, this command saved my life. Thanks a lot!

thanks for highlight saved my time

x2

nahimrgz avatar May 03 '24 15:05 nahimrgz

Have you managed to fix this? Having the same issue, need to keep doing sudo pm2 resurrect after restart.

Thank you friend

jonathanafranio avatar May 28 '24 12:05 jonathanafranio