I am getting started with Monit and don't have a lot of systems knowledge. I have a Ruby app running on Puma. I want to use Monit to automatically restart Puma if it ever dies. I'm currently using the Puma provided Capistrano 2 recipe which uses the control script instead of outputting the PID to a file.
Is there a way to configure monit to check the status of Puma to see if it should be restarted?
This is for Capistrano 3.
You can use the "official" Capistrano recipe for Puma. https://github.com/seuros/capistrano-puma
It has monit scripts built-in to monitor puma server processes. Just include
require 'capistrano/puma/monit'
in yourCapfile
. And runcap <stage> puma:monit:config
. That's it.