PM2 deleted process runs on startup

Saving some time for those who may or may not use pm2 regularly and struggle when searching for an answer on this:

You have to save the edits for pm2:

pm2 save

after making any changes. Unlike most Unix style settings interfaces, pm2 requires you to save your changes from the running version to the config file.

Hope this helps someone even though it is simple! I don't use PM2 all the time and it was really frustrating to not find any answers on SO or anywhere else that referred to the need to use pm2 save when deleting a process.


If you use "pm2 delete {appname}" to delete the last app

pm2 delete app

when you run

pm2 save

It will show

[PM2] Saving current process list...
[PM2] Nothing to save !!!
[PM2] In this case we keep old dump file. To clear dump file you can delete it manually !

Which means, actually, the last app information is still not deleted.

The solution is to create a new dump file.

pm2 cleardump

Then, the app will be deleted permanently.

You can check the pm2 file to see what's actually saved into dump file.

/home/ubuntu/.pm2/dump.pm2

Tags:

Nginx

Node.Js

Pm2