I want to run a python script as a daemon with some arguments as different processes and monitor them continuously. If any of them exits, whether gracefully or with error, I want to start new process using new arguments.
I thought to use pm2 and its nodejs api for this, but I couldn't find any useful information on how to use pm2 api to monitor process messages.
Any ideas how to accomplish it?
You can achieve this with Supervisor, which is a Process Control System that offers an extensive range of options for you to describe the expected behavior.