5

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?

Andrew
  • 3,293
  • 8
  • 32
  • 35

1 Answers1

2

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 your Capfile. And run cap <stage> puma:monit:config . That's it.

Anjan
  • 277
  • 1
  • 2
  • 14