3 ms·
I used PM2[1] as process manager for Node.js, Python services in the cloud servers. It did its job well, apart from ensuring that process is always up, it provi
by Abishek_Muthian 7y ago
I used PM2[1] as process manager for Node.js, Python services in the cloud servers. It did its job well, apart from ensuring that process is always up, it provided monitoring capabilities(incl. emails), capturing logs from the stdout among other things.
Recently I wanted to manage a Golang service, found that PM2 is not stable for it yet and I didn't want to install Node.js just for managing the Golang service; so used Tmux for it. It keeps the process up, we can get the basic process stats as in any terminal and I use external monitoring service for alerts when the service is down[2].
[1]:http://pm2.keymetrics.io/ http://pm2.keymetrics.io/
[2]:https://uptimerobot.com/ https://uptimerobot.com/
- nimrody 7y agoTmux won't restart the service when it fails. It won't start the service when the machine reboots (or even if someone deliberately reboots the machine and forgets about the service). Assuming you're on a modern Linux distribution, it's pretty easy creating a systemd service file which will make it easier to manage the service.
- Abishek_Muthian 7y agoYou're correct, I should have mentioned the purpose. I'm currently testing the service, want it stop when it fails and just not when I exit the SSH; hence the tmux. For restarting the service, systemd is the way to go.