Skip to content
Service Monkey: a flexible service monitor
Ruby Shell
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
examples
lib
test
.gitignore
Gemfile
Gemfile.lock
README.md
Rakefile
sm.gemspec
tasks.txt

README.md

SM: The service monkey

The service monkey keeps an eye on your services. Expect some more flavor text here later.

Design goals are a reasonable cross between the rich configuration of monit (it's just ruby) along with the simplicity of runsv.

This is alpha software

Consider yourself warned.

Usage:

/path/to/sm /path/to/service_directory

sm will daemonize and start any services not running immediately.

Service Definition Files

Service Definition files are just a Ruby class that inherit from a specific class. There's a small DSL used to configure settings for your process and how to run your process. For example:

class Service1 < SM::Service
  setsid true
  command do
    start_command "while true; do sleep 5; done"
    stop_command "kill $DAEMON_PID"
    environment "lol" => "dongs"
  end
end

Expect more documentation on how to drive processes, but here's some more ways to run your process:

class Service2 < SM::Service
  setsid true
  count 2, :in => :environment

  def start(count, environment)
    exec "while true; do sleep 5; done"
  end
end

Development

We use bundler for packaging and dependency managment, and RDoc for API documentation. You can generate the documentation like so:

bundle exec rake rdoc

SM has a test suite that runs with MiniTest::Unit, is non-destructive (although a failed test might leave a process or two around) and can be executed as such:

bundle exec rake test

Please file any patches as pull requests.

Something went wrong with that request. Please try again.