0.0
No commit activity in last 3 years
No release in over 3 years
a script to restart other scripts whenever they crash, stop, get killed. It sends emails, when restart occurs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

KeepRunning

You can run but you can’t hide.

KeepRunning restarts a Ruby script whenever it stops, crashes or is killed.

There’s two modes to use KeepRunning: Using the keep_running bin with a config file (see example_runner_conf) or using a KeepRunning script (see example_runner_script). The only difference is a shebang line and a require line in the KeepRunning script. (Actually the script could as well being used as configuration file; This isn’t true the other way round)

The invokation would look like this:

keep_running example_runner_conf one two three
./example_runner_script one two three

All further arguments will be passed to the process to be run. For the process running $0 will be it’s own path. So basically if your Ruby script works on it’s own, it’s scriptname $0 and command line arguments ARGV will be the same when launched by KeepRunning.

Synopsis

A runner config would look like this:

KeepRunning.run do
  pidfile             '/tmp/keep_running_example'
  email               to: 'keep_running_test@trash-mail.com', from: 'keep_running_test@trash-mail.com', via: :sendmail
  restart_threshold   6
  restart_delay       60
  
  process 'example_script.rb'
end

restart_threshold defines how many seconds must be between restarts until a delay of restart_delay seconds is kicking in.

Caveats

This is a quick and dirty hack. Specs will follow soon.