Introducing mina-supervisord gemPosted under ruby gem mina supervisord mina-supervisord on
I'm happy to announce the first release of gem mina-supervisord.
Mina::Supervisord is a Supervisor (process control system) wrapper for mina.
Add this line to your application's Gemfile:
gem 'mina-supervisord', require: false
And then execute:
Or install it yourself as:
$ gem install mina-supervisord
To restart your app during deploy you might add this to
require 'mina/supervisord' task deploy: :environment do deploy do ... on :launch do invoke :'supervisord:restart', 'puma' end end end
To call it as mina task, eg. to start your puma, you would run this from command line:
bundle exec mina supervisord:start['puma']
puma is a supervisord program.
supervisord:restart- to restart a program (eg.
bundle exec mina supervisord:restart['program'])
supervisord:start- to start a program (eg.
bundle exec mina supervisord:start['program'])
supervisord:stop- to stop a program (eg.
bundle exec mina supervisord:stop['program'])
supervisord:status- to get status of a program (eg.
bundle exec mina supervisord:status['program'])
supervisord:signal- to send a signal to a program (eg.
bundle exec mina supervisord:signal['program,signal'])
supervisord:signal:or_start- to send a signal to a program, or start it if not running (eg.
bundle exec mina supervisord:signal:or_start['program,signal'])
supervisord:restart:or_start- to restart a program, or start it if not running (eg.
bundle exec mina supervisord:restart:or_start['program'])
You might find these extra tasks useful when you are not sure whether your program is running.
Eg. when we do our deploy, we want our
puma server to be restarted or started if not running already. To do that, we have following in our
desc "Phased restart of the application" task :phased_restart => :environment do invoke :'supervisord:signal:or_start', fetch(:application_supervisor_file), "SIGUSR1" end
Bug reports and pull requests are welcome on GitHub at https://github.com/hovancik/mina-supervisord. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
Development of this gem is sponsored by Mix.it.
The gem is available as open source under the terms of the MIT License.
Did you enjoy this? Copy-paste the link from the address bar to your favourite social network to share. Subscribe here.comments powered by Disqus