Daemon::Control

Create init scripts in Perl
Download

Daemon::Control Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • symkat
  • Publisher web site:
  • http://search.cpan.org/~symkat/

Daemon::Control Tags


Daemon::Control Description

Daemon::Control is a Perl module that provides a library for creating init scripts in Perl. Your perl script just needs to set the accessors for what and how you want something to run and the library takes care of the rest.You can launch programs through the shell (/usr/sbin/my_program) or launch Perl code itself into a daemon mode. Single and double fork methods are supported and in double-fork mode all the things you would expect like reopening STDOUT/STDERR, switching UID/GID are supported.SYNOPSISWrite a program that describes the daemon: #!/usr/bin/perl use warnings; use strict; use Daemon::Control; Daemon::Control->new({ name => "My Daemon", lsb_start => '$syslog $remote_fs', lsb_stop => '$syslog', lsb_sdesc => 'My Daemon Short', lsb_desc => 'My Daemon controls the My Daemon daemon.', path => '/home/symkat/etc/init.d/program', program => '/home/symkat/bin/program', program_args => , pid_file => '/tmp/mydaemon.pid', stderr_file => '/tmp/mydaemon.out', stdout_file => '/tmp/mydaemon.out', fork => 2, })->run;You can then call the program: /home/symkat/etc/init.d/program startYou can also make an LSB compatable init script: /home/symkat/etc/init.d/program get_init_file > /etc/init.d/programProduct's homepage


Daemon::Control Related Software