Daemonizing Applications With Pm2: A Step-By-Step Guide
This article provides a comprehensive guide on how to daemonize applications with PM2. It covers the process of setting up unbuffered output, installing and configuring PM2, running processes as daemons, and monitoring them using monit.
PM2 daemonize any app
remember to set unbuffered output flag -u
before running any python script, otherwise there will be no output in pm2 log
install and setup pm2 as daemon:
1 | sudo apt install npm |
run program as daemon:
1 | pm2 start -n <process_name> <executable_name> -- <process_arguments> |