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.
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
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.