A daemon monitor. And more!
Ruby
Pull request Compare This branch is 3 commits ahead, 6 commits behind barrym:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
examples
lib
spec
.document
.gitignore
LICENSE
README.rdoc
Rakefile
TODO.rdoc
VERSION
penguin.gemspec

README.rdoc

Penguin

Description goes here.

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don't break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Usage

Config

require 'penguin'

Penguin.config do |c|
  c.daemon do |d|
    d.name = "My daemon"
    d.loop do
      puts "Doing stuff"
      sleep 5
    end
  end

  c.daemon do |d|
    d.name = "Another daemon"
    d.command = "/path/to/daemon.rb"
  end
end

The first daemon passes a block to #loop which will be run as the main loop in the daemon, no daemon file is required. The second daemon specifies a daemon file which will be run and monitored.

Starting the monitor

Penguin::Monitor.start

Using the client

Must (currently) be run from the directory the monitor was started in.

client = Penguin::Client.new
status = client.status
client.unmonitor(status["daemons"].first)
client.kill(status["daemons"].first)
client.monitor(status["daemons"].first)
client.killall

Other stuff

Example rake tasks in /examples - starting the gui, formatted daemon status.

Copyright

Copyright © 2009 Barry Mitchelson. See LICENSE for details.