G
G
grabbee2021-04-06 18:56:06
Node.js
grabbee, 2021-04-06 18:56:06

How to properly restart processes via pm2?

Deploy using shipit - it creates a separate folder for each update. Therefore, the script will be launched from the new folder. I'm confused. It seemed to me that pm2 delete process_name does not stop already running processes. And pm2 stop process_name ignores the new location of the script, and runs from the old folder.

Do I need to stop (stop) AND delete (delete) processes from the list, and only then start (start)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grabbee, 2021-04-09
@grabbee

There is currently an error in the documentation.
man: delete - stop and delete a process
This command does not stop processes, but simply removes them from the list. This leads to an unexpected result and leaks memory and server CPU. Maybe it's a PM2 bug

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question