dctl - a daemon controller written in Ruby

dctl is a small script for providing daemon functionnalty (start, stop, …) to non-daemon process or script, with automatic handling of pidfiles. dctl is mainly an extended rewrite of the daemons project for learning purpose. It is designed to be small and smart and I try to apply XP’s good practice (unit test)

Major features:

  • Convert any executable file with endless lifecycle into a controllable daemon

  • Automatic handling of pidfiles

  • Command-oriented style (dctl requires cmdparser)

Examples

Start a daemon with redirection of stdout

% dctl start -oout test/infinite.sh

Get the status of a daemon

% dctl status test/infinite.sh

Stop a daemon

% dctl stop test/infinite.sh

Download

The latest version of dctl can be found at :

Installation

The prefered method of installing dctl is currently through its setup.rb file. As dctl stands on cmdparser, you need to have cmdparser installed before. I plan to make a GEM for dctl soon.

from dctl distribution directory:

% [sudo] ruby setup.rb

Notes

If you installed cmdparser as a gem, please check your RUBYOPTS which should looks like:

 % echo $RUBYOPTS
-rubygems

If not, do the following :

% export RUBYOPTS="-rubygems"

Author

Written in 2005 by Bruno Carnazzi <[email protected]>

License

dctl is free software. You can redistribute it under the terms specified in the COPYING file of the Ruby distribution.

Feedback and other resources

At rubyforge.org/projects/dctl/