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 (“less-is-more” philosophy), generic, and well-tested.
Major features:
-
Convert any executable file with endless lifecycle into a controllable daemon
-
Automatic handling of pidfiles
-
Command-oriented style (dctl requires cmdparser >= 1.0.1)
Examples
Start a daemon with redirection of stdout in file ‘out’
% dctl start -oout test/infinite.sh
Get the status of some daemons (here, infinite.sh and sleep)
% dctl status test/infinite.sh sleep
Stop a daemon
% dctl stop test/infinite.sh
Get the status of all daemons
% dctl
Download
The latest version of dctl can be found at :
Installation
As dctl stands on cmdparse, you need to have cmdparse installed before.
Installation with RubyGems:
$ su
# gem install dctl
Installation without RubyGems:
$ tar xfz dctl-x.x.x.tar.gz
$ cd dctl-x.x.x
$ su
# ruby setup.rb
Notes
Please note that dctl test suite only succeeds if launched by a non-root user !
Future
I’m thinking about dctl as a system service manager…
Author
Written in 2005 by Bruno Carnazzi <[email protected]>
License and copyright
dctl is free software. You can redistribute it under the terms specified in the COPYING file of the Ruby distribution.