Daemon-Generic-0.85/0000755000175000017500000000000013132503100012721 5ustar muirmuirDaemon-Generic-0.85/MANIFEST0000644000175000017500000000053413132503100014054 0ustar muirmuirREADME lib/Daemon/Generic.pm lib/Daemon/Generic.pod lib/Daemon/Generic/Event.pm lib/Daemon/Generic/AnyEvent.pm lib/Daemon/Generic/While1.pm Makefile.PL MANIFEST Changes t/daemon.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) Daemon-Generic-0.85/lib/0000755000175000017500000000000013132503100013467 5ustar muirmuirDaemon-Generic-0.85/lib/Daemon/0000755000175000017500000000000013132503100014672 5ustar muirmuirDaemon-Generic-0.85/lib/Daemon/Generic.pm0000644000175000017500000003002713132502772016624 0ustar muirmuir package Daemon::Generic; use strict; use warnings; require Exporter; require POSIX; use Getopt::Long; use File::Slurp; use File::Flock::Forking; use File::Flock; our @ISA = qw(Exporter); our @EXPORT = qw(newdaemon); our $VERSION = 0.85; our $force_quit_delay = 15; our $package = __PACKAGE__; our $caller; sub newdaemon { my (%args) = @_; my $pkg = $caller || caller() || 'main'; my $foo = bless {}, $pkg; unless ($foo->isa($package)) { no strict qw(refs); my $isa = \@{"${pkg}::ISA"}; unshift(@$isa, $package); } bless $foo, 'This::Package::Does::Not::Exist'; undef $foo; new($pkg, %args); } sub new { my ($pkg, %args) = @_; if ($pkg eq __PACKAGE__) { $pkg = caller() || 'main'; } srand(time ^ ($$ << 5)) unless $args{no_srand}; my $av0 = $0; $av0 =~ s!/!/.!g; my $self = { gd_av0 => $av0, gd_args => \%args, gd_pidfile => $args{pidfile}, gd_logpriority => $args{logpriority}, gd_progname => $args{progname} ? $args{progname} : $0, gd_pidbase => $args{pidbase} ? $args{pidbase} : ($args{progname} ? "/var/run/$args{progname}" : "/var/run/$av0"), gd_foreground => $args{foreground} || 0, configfile => $args{configfile} ? $args{configfile} : ($args{progname} ? "/etc/$args{progname}.conf" : "/etc/$av0"), debug => $args{debug} || 0, }; bless $self, $pkg; $self->gd_getopt; $self->gd_parse_argv; my $do = $self->{do} = $ARGV[0]; $self->gd_help if $do eq 'help'; $self->gd_version if $do eq 'version'; $self->gd_install if $do eq 'install'; $self->gd_uninstall if $do eq 'uninstall'; $self->gd_pidfile unless $self->{gd_pidfile}; my %newconfig = $self->gd_preconfig; $self->{gd_pidfile} = $newconfig{pidfile} if $newconfig{pidfile}; print "PIDFILE=$self->{gd_pidfile}\n" if $self->{debug}; print "Configuration looks okay\n" if $do eq 'check'; my $pidfile = $self->{gd_pidfile}; my $killed = 0; my $locked = 0; if (-e $pidfile) { if ($locked = lock($pidfile, undef, 'nonblocking')) { # old process is dead if ($do eq 'status') { print "$self->{gd_progname} dead\n"; exit 1; } } else { sleep(2) if -M $pidfile < 2/86400; my $oldpid = read_file($pidfile); chomp($oldpid); if ($oldpid) { if ($do eq 'stop' or $do eq 'restart') { $killed = $self->gd_kill($oldpid); $locked = lock($pidfile); if ($do eq 'stop') { unlink($pidfile); exit; } } elsif ($do eq 'reload') { if (kill(1,$oldpid)) { print "Requested reconfiguration\n"; exit; } else { print "Kill failed: $!\n"; } } elsif ($do eq 'status') { if (kill(0,$oldpid)) { print "$self->{gd_progname} running - pid $oldpid\n"; $self->gd_check($pidfile, $oldpid); exit 0; } else { print "$self->{gd_progname} dead\n"; exit 1; } } elsif ($do eq 'check') { if (kill(0,$oldpid)) { print "$self->{gd_progname} running - pid $oldpid\n"; $self->gd_check($pidfile, $oldpid); exit; } } elsif ($do eq 'start' || $do eq 'debug') { print "\u$self->{gd_progname} is already running (pid $oldpid)\n"; exit; # according to LSB, this is no error } } else { $self->gd_error("Pid file $pidfile is invalid but locked, exiting\n"); } } } else { $locked = lock($pidfile, undef, 'nonblocking') or die "Could not lock pid file $pidfile: $!"; } if ($do eq 'reload' || $do eq 'stop' || $do eq 'check' || ($do eq 'restart' && ! $killed)) { print "No $self->{gd_progname} running\n"; } if ($do eq 'stop') { unlink($pidfile); exit; } if ($do eq 'status') { print "No $self->{gd_progname} running\n"; exit 3; } if ($do eq 'check') { $self->gd_check($pidfile); exit } unless ($do eq 'reload' || $do eq 'restart' || $do eq 'start' || $do eq 'debug') { $self->gd_other_cmd($do, $locked); } unless ($self->{gd_foreground} || $do eq 'debug') { $self->gd_daemonize; } $locked or lock($pidfile, undef, 'nonblocking') or die "Could not lock PID file $pidfile: $!"; write_file($pidfile, "$$\n"); print STDERR "Starting up...\n"; $self->gd_postconfig(%newconfig); $self->gd_setup_signals; $self->gd_run; unlink($pidfile); exit(0); } sub gd_check {} sub gd_more_opt { return() } sub gd_getopt { my $self = shift; Getopt::Long::Configure("auto_version"); GetOptions( 'configfile=s' => \$self->{configfile}, 'foreground!' => \$self->{gd_foreground}, 'debug!' => \$self->{debug}, $self->{gd_args}{options} ? %{$self->{gd_args}{options}} : (), $self->gd_more_opt(), ) or exit($self->gd_usage()); if (@ARGV < ($self->{gd_args}{minimum_args} || 1)) { exit($self->gd_usage()); } if (@ARGV > ($self->{gd_args}{maximum_args} || 1)) { exit($self->gd_usage()); } } sub gd_parse_argv { } sub gd_help { my $self = shift; exit($self->gd_usage($self->{gd_args})); } sub gd_version { my $self = shift; no strict qw(refs); my $v = $self->{gd_args}{version} || ${ref($self)."::VERSION"} || $::VERSION || $main::VERSION || "?"; print "$self->{gd_progname} - version $v\n";; exit; } sub gd_pidfile { my $self = shift; my $x = $self->{configfile}; $x =~ s!/!.!g; $self->{gd_pidfile} = "$self->{gd_pidbase}$x.pid"; } sub gd_other_cmd { my $self = shift; $self->gd_usage; exit(1); } sub gd_redirect_output { my $self = shift; return if $self->{gd_foreground}; open(STDOUT, ">/dev/null") or die("open >/dev/null: $!"); open(STDIN, "&STDOUT") or tmpdie("dup stdout > stderr: $!"); } sub gd_reopen_output { my $self = shift; return if $self->{gd_foreground}; my $logname = $self->gd_logname; my $p = $self->{gd_logpriority} ? "-p $self->{gd_logpriority}" : ""; open(STDERR, "|logger $p -t '$logname'") or tmpdie("open |logger $p -t $logname: $!"); open(STDOUT, ">&STDERR") or tmpdie("dup stderr > stdout: $!"); select(STDERR); $| = 1; select(STDOUT); $| = 1; } sub gd_daemonize { my $self = shift; open(TMPERR, ">&STDERR") or die "dup STDERR > TMPERR: $!"; print "Starting $self->{gd_progname} server\n"; $self->gd_redirect_output(); my $pid; POSIX::_exit(0) if $pid = fork; tmpdie("Could not fork: $!") unless defined $pid; POSIX::setsid(); $self->gd_reopen_output(); print "Sucessfully daemonized\n" or tmpdie("write to |logger: $!"); close(TMPERR); } sub tmpdie { my $msg = "@_"; $msg .= sprintf(" at %s line %d\n", (caller())[1,2]) unless $msg =~ /\n$/; print TMPERR $msg; exit 1; } sub gd_logname { my $self = shift; return $self->{gd_progname}."[$$]"; } sub gd_reconfig_event { my $self = shift; print STDERR "Reconfiguration requested\n"; $self->gd_postconfig($self->gd_preconfig()); } sub gd_quit_event { my $self = shift; print STDERR "Quitting...\n"; exit(0); } sub gd_setup_signals { my $self = shift; $SIG{INT} = sub { $self->gd_quit_event() }; $SIG{HUP} = sub { $self->gd_reconfig_event() }; } sub gd_run { die "must defined gd_run()" } sub gd_error { my $self = shift; my $e = shift; my $do = $self->{do}; if ($do && $do eq 'stop') { warn $e; } else { die $e; } } sub gd_flags_more { return () } sub gd_flags { my $self = shift; return ( '-c file' => "Specify configuration file (instead of $self->{configfile})", '-f' => "Run in the foreground (don't detach)", $self->gd_flags_more ); } sub gd_commands_more { return () } sub gd_commands { my $self = shift; return ( start => "Starts a new $self->{gd_progname} if there isn't one running already", stop => "Stops a running $self->{gd_progname}", reload => "Causes a running $self->{gd_progname} to reload it's config file. Starts a new one if none is running.", restart => "Stops a running $self->{gd_progname} if one is running. Starts a new one.", $self->gd_commands_more(), ($self->gd_can_install() ? ('install' => "Setup $self->{gd_progname} to run automatically after reboot") : ()), ($self->gd_can_uninstall() ? ('uninstall' => "Do not run $self->{gd_progname} after reboots") : ()), check => "Check the configuration file and report the daemon state", help => "Display this usage info", version => "Display the version of $self->{gd_progname}", debug => "Starts a new $self->{gd_progname} in the foreground", ) } sub gd_positional_more { return() } sub gd_alts { my $offset = shift; my @results; for (my $i = $offset; $i <= $#_; $i += 2) { push(@results, $_[$i]); } return @results; } sub gd_usage { my $self = shift; require Text::Wrap; import Text::Wrap; my $col = 15; my @flags = $self->gd_flags; my @commands = $self->gd_commands; my @positional = $self->gd_positional_more; my $summary = "Usage: $self->{gd_progname} "; my $details = ''; for my $i (gd_alts(0, @flags)) { $summary .= "[ $i ] "; } $summary .= "{ "; $summary .= join(" | ", gd_alts(0, @commands)); $summary .= " } "; $summary .= join(" ", gd_alts(0, @positional)); my (@all) = (@flags, @commands, @positional); while (@all) { my ($key, $desc) = splice(@all, 0, 2); local($Text::Wrap::columns) = 79; local($Text::Wrap::unexpand) = 0; $details .= wrap( sprintf(" %-${col}s ", $key), " " x ($col + 2), $desc); $details .= "\n"; } print "$summary\n$details"; return 0; } sub gd_install_pre {} sub gd_install_post {} sub gd_can_install { my $self = shift; require File::Basename; my $basename = File::Basename::basename($0); if ( -x "/usr/sbin/update-rc.d" && -x $0 && $0 !~ m{^(?:/usr|/var)?/tmp/} && eval { symlink("",""); 1 } && -d "/etc/init.d" && ! -e "/etc/init.d/$basename" ) { return sub { $self->gd_install_pre("update-rc.d"); require Cwd; my $abs_path = Cwd::abs_path($0); symlink($abs_path, "/etc/init.d/$basename") or die "Install failed: symlink /etc/init.d/$basename -> $abs_path: $!\n"; print "+ /usr/sbin/update-rc.d $basename defaults\n"; system("/usr/sbin/update-rc.d", $basename, "defaults"); my $exit = $? >> 8; $self->gd_install_post("update-rc.d"); exit($exit) if $exit; }; } return 0; } sub gd_install { my $self = shift; my $ifunc = $self->gd_can_install(); die "Install command not supported\n" unless $ifunc; &$ifunc($self); exit(0); } sub gd_uninstall_pre {} sub gd_uninstall_post {} sub gd_can_uninstall { my $self = shift; require File::Basename; my $basename = File::Basename::basename($0); require Cwd; my $abs_path = Cwd::abs_path($0) || 'no abs path'; my $link = readlink("/etc/init.d/$basename") || 'no link'; if ( $link eq $abs_path && -x "/usr/sbin/update-rc.d" ) { return sub { $self->gd_uninstall_pre("update-rc.d"); unlink("/etc/init.d/$basename"); print "+ /usr/sbin/update-rc.d $basename remove\n"; system("/usr/sbin/update-rc.d", $basename, "remove"); my $exit = $? >> 8; $self->gd_uninstall_post("update-rc.d"); exit($exit) if $exit; } } return 0; } sub gd_uninstall { my $self = shift; my $ufunc = $self->gd_can_uninstall(); die "Cannot uninstall\n" unless $ufunc; &$ufunc($self); exit(0); } sub gd_kill_groups { 0 } sub gd_kill { my ($self, $pid) = @_; $pid = -abs($pid) if $self->gd_kill_groups(); my $talkmore = 0; my $killed = 0; if (kill(0, $pid)) { $killed = 1; kill(2,$pid); print "Killing $pid\n"; my $t = time; sleep(1) if kill(0, $pid); if ($force_quit_delay && kill(0, $pid)) { print "Waiting for $pid to die...\n"; $talkmore = 1; while(kill(0, $pid) && time - $t < $force_quit_delay) { sleep(1); } } if (kill(15, $pid)) { print "Killing $pid with -TERM...\n"; if ($force_quit_delay) { while(kill(0, $pid) && time - $t < $force_quit_delay * 2) { sleep(1); } } else { sleep(1) if kill(0, $pid); } } if (kill(9, $pid)) { print "Killing $pid with -KILL...\n"; my $k9 = time; my $max = $force_quit_delay * 4; $max = 60 if $max < 60; while(kill(0, $pid)) { if (time - $k9 > $max) { print "Giving up on $pid ever dying.\n"; exit(1); } print "Waiting for $pid to die...\n"; sleep(1); } } print "Process $pid is gone\n" if $talkmore; } else { print "Process $pid no longer running\n"; } return $killed; } sub gd_preconfig { } sub gd_postconfig { } 1; Daemon-Generic-0.85/lib/Daemon/Generic/0000755000175000017500000000000013132503100016246 5ustar muirmuirDaemon-Generic-0.85/lib/Daemon/Generic/While1.pm0000644000175000017500000000677312223663721017772 0ustar muirmuirpackage Daemon::Generic::While1; use strict; use warnings; use Carp; require Daemon::Generic; require POSIX; require Exporter; our @ISA = qw(Daemon::Generic Exporter); our @EXPORT = @Daemon::Generic::EXPORT; our $VERSION = 0.84; sub newdaemon { local($Daemon::Generic::caller) = caller() || 'main'; local($Daemon::Generic::package) = __PACKAGE__; Daemon::Generic::newdaemon(@_); } sub gd_setup_signals { my ($self) = @_; $SIG{HUP} = sub { $self->{gd_sighup} = time; }; my $child; $SIG{INT} = sub { $self->{gd_sigint} = time; # # We'll be getting a SIGTERM in a bit if we're not dead, so let's use it. # $SIG{TERM} = sub { $self->gd_quit_event(); kill(15, $child) if $child; # if we're still alive, let's stay that way }; }; } sub gd_sleep { my ($self, $period) = @_; croak "Sleep period must be defined" unless defined $period; my $hires; if ($period*1000 != int($period*1000)) { $hires = 1; require Time::HiRes; import Time::HiRes qw(time sleep); } my $t = time; while (time - $t < $period) { return if $self->{gd_sigint}; return if $self->{gd_sighup}; if ($hires) { my $p = (time - $t < 1) ? time - $t : 1; sleep($p); } else { sleep(1); } } } sub gd_run { my ($self) = @_; while(1) { if ($self->{gd_sigint}) { $self->{gd_sigint} = 0; $self->gd_quit_event(); } if ($self->{gd_sighup}) { $self->{gd_sighup} = 0; $self->gd_reconfig_event(); } $self->gd_run_body(); } } sub gd_reconfig_event { my $self = shift; print STDERR "Reconfiguration requested\n"; $self->gd_postconfig($self->gd_preconfig()); } sub gd_quit_event { print STDERR "Quitting...\n"; exit(0); } sub gd_run_body { die "must override gd_run_body()" } 1; =head1 NAME Daemon::Generic::While1 - Daemon framework with default while(1) loop =head1 SYNOPSIS @ISA = qw(Daemon::Generic::While1); sub gd_run_body { # stuff } =head1 DESCRIPTION This is a slight variation on L: a default C provided. It has a while(1) loop that calls C over and over. It checks for reconifg and and terminate events and only actions them between calls to C. Terminate events will be forced through after C<$Daemon::Generic::force_quit_delay> seconds if C doesn't return quickly enough. =head1 SUBCLASS METHODS REQUIRD The following method is required to be overridden to subclass Daemon::Generic::While1: =over 15 =item gd_run_body() This method will be called over and over. This method should include a call to C (or a bit more). Reconfig events will not interrupt it. Quit events will only interrupt it after 15 seconds. =back =head1 ADDITIONAL METHODS The following additional methods are available for your use (as compared to L): =over 15 =item gd_sleep($period) This will sleep for C<$period> seconds but in one-second intervals so that if a SIGINT or SIGHUP arrives the sleep period can end more quickly. Using this makes it safe for C to sleep for longer than C<$Daemon::Generic::force_quit_delay> seconds at a time. =back =head1 ADDITIONAL MEMBER DATA The following additional bits of member data are defined: =over 15 =item gd_sigint The time at which an (unprocessed) SIGINT was received. =item gd_sighup The time at which an (unprocessed) SIGHUP was received. =back =head1 LICENSE Copyright (C) 2006-2010 David Muir Sharnoff . Copyright (C) 2011 Google, Inc. This module may be used and distributed on the same terms as Perl itself. Daemon-Generic-0.85/lib/Daemon/Generic/AnyEvent.pm0000644000175000017500000000457512223663734020374 0ustar muirmuir package Daemon::Generic::AnyEvent; use strict; use warnings; require Daemon::Generic; require AnyEvent; require Exporter; our @ISA = qw(Daemon::Generic Exporter); our @EXPORT = @Daemon::Generic::EXPORT; our $VERSION = 0.84; sub newdaemon { local($Daemon::Generic::caller) = caller() || 'main'; local($Daemon::Generic::package) = __PACKAGE__; Daemon::Generic::newdaemon(@_); } sub gd_setup_signals { my $self = shift; $self->{gd_reload_event} = AnyEvent->signal( signal => 'HUP', cb => sub { $self->gd_reconfig_event; $self->{gd_timer}->cancel() if $self->{gd_timer}; $self->gd_setup_timer(); }, ); $self->{gd_quit_event} = AnyEvent->signal( signal => 'INT', cb => sub { $self->gd_quit_event; }, ); } sub gd_setup_timer { my $self = shift; if ($self->can('gd_run_body')) { my $interval = ($self->can('gd_interval') && $self->gd_interval()) || 1; $self->{gd_timer} = AnyEvent->timer( cb => sub { $self->gd_run_body() }, interval => $interval, ); } } sub gd_run { my $self = shift; $self->gd_setup_timer(); Event::loop(); } sub gd_quit_event { my $self = shift; print STDERR "Quitting...\n"; Event::unloop_all(); } 1; =head1 NAME Daemon::Generic::AnyEvent - Generic daemon framework with AnyEvent.pm =head1 SYNOPSIS use Daemon::Generic::AnyEvent; use Some::Event::Loop::Supported::By::AnyEvent; @ISA = qw(Daemon::Generic::AnyEvent); sub gd_preconfig { # stuff } =head1 DESCRIPTION Daemon::Generic::AnyEvent is a subclass of L that predefines some methods: =over 15 =item gd_run() Setup a periodic callback to C if there is a C. Call C. =item gd_setup_signals() Bind SIGHUP to call C. Bind SIGINT to call C. =back To use Daemon::Generic::Event, you have to provide a C method. It can be empty if you have a C. Set up your own events in C and C. If you have a C method, it will be called once per second or every C seconds if you have a C method. Unlike in L, C should not include a call to C. =head1 LICENSE Copyright (C) 2006-2010 David Muir Sharnoff . Copyright (C) 2011 Google, Inc. This module may be used and distributed on the same terms as Perl itself. Daemon-Generic-0.85/lib/Daemon/Generic/Event.pm0000644000175000017500000000452312223663740017712 0ustar muirmuir package Daemon::Generic::Event; use strict; use warnings; require Daemon::Generic; require Event; require Exporter; our @ISA = qw(Daemon::Generic Exporter); our @EXPORT = @Daemon::Generic::EXPORT; our $VERSION = 0.84; sub newdaemon { local($Daemon::Generic::caller) = caller() || 'main'; local($Daemon::Generic::package) = __PACKAGE__; Daemon::Generic::newdaemon(@_); } sub gd_setup_signals { my $self = shift; my $reload_event = Event->signal( signal => 'HUP', desc => 'reload on SIGHUP', prio => 6, cb => sub { $self->gd_reconfig_event; $self->{gd_timer}->cancel() if $self->{gd_timer}; $self->gd_setup_timer(); }, ); my $quit_event = Event->signal( signal => 'INT', cb => sub { $self->gd_quit_event; }, ); } sub gd_setup_timer { my $self = shift; if ($self->can('gd_run_body')) { my $interval = ($self->can('gd_interval') && $self->gd_interval()) || 1; $self->{gd_timer} = Event->timer( cb => [ $self, 'gd_run_body' ], interval => $interval, hard => 0, ); } } sub gd_run { my $self = shift; $self->gd_setup_timer(); Event::loop(); } sub gd_quit_event { my $self = shift; print STDERR "Quitting...\n"; Event::unloop_all(); } 1; =head1 NAME Daemon::Generic::Event - Generic daemon framework with Event.pm =head1 SYNOPSIS use Daemon::Generic::Event; @ISA = qw(Daemon::Generic::Event); sub gd_preconfig { # stuff } =head1 DESCRIPTION Daemon::Generic::Event is a subclass of L that predefines some methods: =over 15 =item gd_run() Setup a periodic callback to C if there is a C. Call C. =item gd_setup_signals() Bind SIGHUP to call C. Bind SIGINT to call C. =back To use Daemon::Generic::Event, you have to provide a C method. It can be empty if you have a C. Set up your own events in C and C. If you have a C method, it will be called once per second or every C seconds if you have a C method. Unlike in L, C should not include a call to C. =head1 LICENSE Copyright (C) 2006-2010 David Muir Sharnoff . Copyright (C) 2011 Google, Inc. This module may be used and distributed on the same terms as Perl itself. Daemon-Generic-0.85/lib/Daemon/Generic.pod0000644000175000017500000002550612223663417017004 0ustar muirmuir=head1 NAME Daemon::Generic - framework to provide start/stop/reload for a daemon =head1 SYNOPSIS use Daemon::Generic; sub gd_run { ... stuff } newdaemon(); =head1 DESCRIPTION Daemon::Generic provides a framework for starting, stopping, reconfiguring daemon-like programs. The framework provides for standard commands that work for as init.d files and as apachectl-like commands. Programs that use Daemon::Generic subclass Daemon::Generic to override its behavior. Almost everything that Genric::Daemon does can be overridden as needed. =head1 EXAMPLE USAGE OUTPUT Unless overridden, the usage output for your program will look something like this: Usage: $progname [ -c file ] [ -f ] { start | stop | reload | restart | help | version | check } -c Specify configuration file (defaults to $configfile) -f Run in the foreground (don't detach) start Starts a new $progname if there isn't one running already stop Stops a running $progname reload Causes a running $progname to reload it's config file. Starts a new one if none is running. restart Stops a running $progname if one is running. Starts a new one. check Check the configuration file and report the daemon state help Display this usage info version Display the version of $progname =head1 CONSTRUCTION To hand control over to C, call C. Control will be handed back through method calls to functions you define. Your C<@ISA> will be modified to include C if if it isn't already there. These are the arguments to C. Defaults are in (parenthesis). =over 15 =item progname (C<$0>) The name of this program. This will be used for logging and for naming the PID file. =item configfile (C) The location of the configuration file for this daemon. =item pidbase (/var/run/$progname) We include the configuration file name as part of the pid file in case there are multiple instances of this daemon. The pidbase is the part of the PID file that does not include the configuration file name. =item pidfile (C<$pidbase.$configfile.pid>) The location of the process id file. =item foreground (C<0>) Do not detach/daemon and run in the foreground instead. =item debug (C<0>) Turn on debugging. =item no_srand (C<0>) Normall srand() is called. If no_srand is set then srand() won't be called. =item options () Additional arguments for L which is used to parse C<@ARGV>. Alternatively: define C<&gd_more_opt()>. =item minimum_args (C<1>) Minimum number of @ARGV arguments after flags have been processed. =item maximum_args (C<1>) Maximum number of @ARGV arguments after flags have been processed. =item version (C<$pkg::VERSION>) The version number of the daemon. =item logpriority Used for C. =back =head1 MUST-OVERRIDE CALLBACK METHODS The package that subclasses Daemon::Generic must provide the following callback methods. =over 15 =item gd_run() This is where you put your main program. It is okay to change userid/group as the first action of gd_run(). =back =head1 MAY-OVERRIDE CALLBACK METHODS The package that subclasses Daemon::Generic does not have to override these methods but it may want to. =over 15 =item gd_preconfig() C is called to parse the configuration file (C<$self-E{configfile}>). Preconfig is called on all invocations of the daemon (C, C, C, etc). It shouldn't start anything but it can and should verify that the config file is fine. The return value should be a hash. With one exception, the return value is only used by C. The exception is that C may return a revised PID file location (key C). Most uses of Daemon::Generic should define C. =item gd_postconfig(%config) Postconfig() is called only when the daemon is actually starting up. (Or on reconfigs). It is passed the return value from C. =item gd_setup_signals() Set things up so that SIGHUP calls gd_reconfig_event() and SIGINT calls gd_quit_event(). It will call these at any time so if you want to delay signal delivery or something you should override this method. =item gd_getopt() This is invoked to parse the command line. Useful things to modify are: =over 20 =item $self->{configfile} The location of the configuration file to be parsed by C. =item $self->{foreground} Run in the foreground (don't daemonize). =item $self->{debug} Use it yourself. =back The supplied C method uses L. =item gd_parse_argv() Parse any additional command line arguments beyond what C handled. C<$ARGV[0]> needs to be left alone if it is one of the following standard items: =over 10 =item start Start up a new daemon. =item stop Stop the running daemon. =item restart Stop the running daemon, start a new one. =item reload Send a signal to the running daemon, asking it to reconfigure itself. =item check Just check the configuration file. =item help Print the help screen (probably usage()). =item version Display the daemon's version. =back There is no default C. =item gd_check($pidfile, $pid) Normal behavior: return. Define additional checks to run when the C command is given. A C<$pid> will only be supplied if there is a daemon running. =item gd_version() Normal behavior: display a version message and exit. =item gd_help() Normal behavior: call C. =item gd_commands_more() Used by C: provide information on additional commands beyond C, C, C, etc. Return is an array of key value pairs. sub gd_commands_more { return ( savestate => 'Tell xyz server to save its state', reset => 'Tell xyz servr to reset', ); } =item gd_flags_more Like C but defines additional command line flags. There should also be a C or an C argument to C. =item gd_positional_more Like C but defines positional arguments. =item gd_usage() Display a usage message. The return value from C is the exit code for the program. =item gd_more_opt() () Additional arguments for L which is used to parse C<@ARGV>. Alternatively: pass C to C. =item gd_pidfile() Figure out the PID file should be. =item gd_error() Print out an error (call die?) =item gd_other_cmd() Called C<$ARGV[0]> isn't one of the commands that Daemon::Generic knows by default. Default behavior: call C and C. =item gd_daemonize() Normal behavior: C, C, detach from tty. =item gd_redirect_output() This is a mis-named method. Sorry. This directs C/C/C to C as part of daemonizing. Used by C. =item gd_reopen_output() After daemonizing, output file descriptors are be re-established. Normal behavior: redirect C and C to C. Used by C. =item gd_logname() Normal behavior: C<$progname[$$]>. Used by C. =item gd_reconfig_event() Normal behavior: call C. Only referenced by C. =item gd_quit_event() Normal behavior: exit. Only referenced by C. =item gd_kill_groups() Return true if gd_kill should kill process groups ($pid) instead of just the one daemon ($pid). Default is false. =item gd_kill($pid) Used by the C and C commands to get rid of the old daemon. Normal behavior: send a SIGINT. Check to see if process C<$pid> has died. If it has not, keep checking and if it's still alive. After C<$Daemon::Generic::force_quit_delay> seconds, send a SIGTERM. Keep checking. After another C<$Daemon::Generic::force_quit_delay> seconds, send a SIGKILL (-9). Keep checking. After C<$Daemon::Generic::force_quit_delay * 4> seconds or 60 seconds (whichever is smaller), give up and exit(1). =item gd_install Installs the daemon so that it runs automatically at next reboot. Currently done with a symlink to C<$0> and C. Please send patches for other methods! =item gd_can_install Returns a function to do an C if installation is possible. Returns C<0> otherwise. =item gd_install_pre($method) Normal behavior: return. Called just before doing an installation. The method indicates the installation method (currently always C.) =item gd_install_post($method) Normal behavior: return. Called just after doing an installation. =item gd_uninstall Will remove the daemon from the automatic startup regime. =item gd_can_uninstall Returns a function to do the work for C if it's possible. C<0> otherwise. =item gd_uninstall_pre($method) Normal behavior: return. Called just before doing an un-installation. The method indicates the installation method (currently always C.) =item gd_install_post($method) Normal behavior: return. Called just after doing an un-installation. =back =head1 MEMBER DATA Since you need to subclass Daemon::Generic, you need to know what the internal data structures for Daemon::Generic are. With two exceptions, all of the member data items begin with the prefix C. =over 15 =item configfile The location of the configuration file. (Not used by Daemon::Generic). =item debug Display debugging? (Not used by Daemon::Generic) =item gd_args The original C<%args> passed to C. =item gd_progname The process name. (defaults to $0) =item gd_pidfile The location of the process ID file. =item gd_logpriority Used for C. =item gd_foreground Are we running in the foreground? =back =head1 EXAMPLE PROGRAM my $sleeptime = 1; newdaemon( progname => 'ticktockd', pidfile => '/var/run/ticktockd.pid', configfile => '/etc/ticktockd.conf', ); sub gd_preconfig { my ($self) = @_; open(CONFIG, "<$self->{configfile}") or die; while() { $sleeptime = $1 if /^sleeptime\s+(\d+)/; } close(CONFIG); return (); } sub gd_run { while(1) { sleep($sleeptime); print scalar(localtime(time))."\n"; } } =head1 SEE ALSO With a while(1) and delayed signal delivery: L. With L: L. With L: L. Modules that use Daemon::Generic: L; L (rinetd.pl) Other modules that do similar things: L, L, L, L, L, L, L. =head1 LICENSE Copyright (C) 2006-2010 David Muir Sharnoff . Copyright (C) 2011 Google, Inc. This module may be used and distributed on the same terms as Perl itself. =head1 PACKAGERS Daemon::Generic is packaged for Fedora by Emmanuel Seyman . Daemon-Generic-0.85/README0000644000175000017500000003207712223664005013626 0ustar muirmuirNAME Daemon::Generic - framework to provide start/stop/reload for a daemon SYNOPSIS use Daemon::Generic; sub gd_run { ... stuff } newdaemon(); DESCRIPTION Daemon::Generic provides a framework for starting, stopping, reconfiguring daemon-like programs. The framework provides for standard commands that work for as init.d files and as apachectl-like commands. Programs that use Daemon::Generic subclass Daemon::Generic to override its behavior. Almost everything that Genric::Daemon does can be overridden as needed. EXAMPLE USAGE OUTPUT Unless overridden, the usage output for your program will look something like this: Usage: $progname [ -c file ] [ -f ] { start | stop | reload | restart | help | version | check } -c Specify configuration file (defaults to $configfile) -f Run in the foreground (don't detach) start Starts a new $progname if there isn't one running already stop Stops a running $progname reload Causes a running $progname to reload it's config file. Starts a new one if none is running. restart Stops a running $progname if one is running. Starts a new one. check Check the configuration file and report the daemon state help Display this usage info version Display the version of $progname CONSTRUCTION To hand control over to "Daemon::Generic", call "newdaemon()". Control will be handed back through method calls to functions you define. Your @ISA will be modified to include "Daemon::Generic" if if it isn't already there. These are the arguments to "newdaemon()". Defaults are in (parenthesis). progname ($0) The name of this program. This will be used for logging and for naming the PID file. configfile ("/etc/$progname.conf") The location of the configuration file for this daemon. pidbase (/var/run/$progname) We include the configuration file name as part of the pid file in case there are multiple instances of this daemon. The pidbase is the part of the PID file that does not include the configuration file name. pidfile ("$pidbase.$configfile.pid") The location of the process id file. foreground (0) Do not detach/daemon and run in the foreground instead. debug (0) Turn on debugging. no_srand (0) Normall srand() is called. If no_srand is set then srand() won't be called. options () Additional arguments for Getopt::Long::GetOptions which is used to parse @ARGV. Alternatively: define "&gd_more_opt()". minimum_args (1) Minimum number of @ARGV arguments after flags have been processed. maximum_args (1) Maximum number of @ARGV arguments after flags have been processed. version ($pkg::VERSION) The version number of the daemon. logpriority Used for "logger -p". MUST-OVERRIDE CALLBACK METHODS The package that subclasses Daemon::Generic must provide the following callback methods. gd_run() This is where you put your main program. It is okay to change userid/group as the first action of gd_run(). MAY-OVERRIDE CALLBACK METHODS The package that subclasses Daemon::Generic does not have to override these methods but it may want to. gd_preconfig() "gd_preconfig()" is called to parse the configuration file ("$self->{configfile}"). Preconfig is called on all invocations of the daemon ("daemon reload", "daemon check", "daemon stop", etc). It shouldn't start anything but it can and should verify that the config file is fine. The return value should be a hash. With one exception, the return value is only used by "gd_postconfig()". The exception is that "gd_preconfig()" may return a revised PID file location (key "pidfile"). Most uses of Daemon::Generic should define "gd_preconfig". gd_postconfig(%config) Postconfig() is called only when the daemon is actually starting up. (Or on reconfigs). It is passed the return value from "gd_preconfig". gd_setup_signals() Set things up so that SIGHUP calls gd_reconfig_event() and SIGINT calls gd_quit_event(). It will call these at any time so if you want to delay signal delivery or something you should override this method. gd_getopt() This is invoked to parse the command line. Useful things to modify are: $self->{configfile} The location of the configuration file to be parsed by "gd_preconfig()". $self->{foreground} Run in the foreground (don't daemonize). $self->{debug} Use it yourself. The supplied "gd_getopt()" method uses Getopt::Long. gd_parse_argv() Parse any additional command line arguments beyond what "gd_getopt()" handled. $ARGV[0] needs to be left alone if it is one of the following standard items: start Start up a new daemon. stop Stop the running daemon. restart Stop the running daemon, start a new one. reload Send a signal to the running daemon, asking it to reconfigure itself. check Just check the configuration file. help Print the help screen (probably usage()). version Display the daemon's version. There is no default "gd_parse_argv()". gd_check($pidfile, $pid) Normal behavior: return. Define additional checks to run when the "check" command is given. A $pid will only be supplied if there is a daemon running. gd_version() Normal behavior: display a version message and exit. gd_help() Normal behavior: call "gd_usage()". gd_commands_more() Used by "gd_usage()": provide information on additional commands beyond "start", "stop", "reload", etc. Return is an array of key value pairs. sub gd_commands_more { return ( savestate => 'Tell xyz server to save its state', reset => 'Tell xyz servr to reset', ); } gd_flags_more Like "gd_commands_more()" but defines additional command line flags. There should also be a "gd_more_opt()" or an "options" argument to "new()". gd_positional_more Like "gd_commands_more()" but defines positional arguments. gd_usage() Display a usage message. The return value from "gd_usage()" is the exit code for the program. gd_more_opt() () Additional arguments for Getopt::Long::GetOptions which is used to parse @ARGV. Alternatively: pass "options" to "new()". gd_pidfile() Figure out the PID file should be. gd_error() Print out an error (call die?) gd_other_cmd() Called $ARGV[0] isn't one of the commands that Daemon::Generic knows by default. Default behavior: call "gd_usage()" and exit(1). gd_daemonize() Normal behavior: "fork()", "fork()", detach from tty. gd_redirect_output() This is a mis-named method. Sorry. This directs "STDOUT"/"STDERR"/"STDIN" to "/dev/null" as part of daemonizing. Used by "gd_daemonize()". gd_reopen_output() After daemonizing, output file descriptors are be re-established. Normal behavior: redirect "STDOUT" and "STDERR" to "logger -t $progname[$$]". Used by "gd_daemonize()". gd_logname() Normal behavior: $progname[$$]. Used by "gd_redirect_output()". gd_reconfig_event() Normal behavior: call "gd_postconfig(gd_preconfig))". Only referenced by "gd_setup_signals()". gd_quit_event() Normal behavior: exit. Only referenced by "gd_setup_signals()". gd_kill_groups() Return true if gd_kill should kill process groups ($pid) instead of just the one daemon ($pid). Default is false. gd_kill($pid) Used by the "stop" and "restart" commands to get rid of the old daemon. Normal behavior: send a SIGINT. Check to see if process $pid has died. If it has not, keep checking and if it's still alive. After $Daemon::Generic::force_quit_delay seconds, send a SIGTERM. Keep checking. After another $Daemon::Generic::force_quit_delay seconds, send a SIGKILL (-9). Keep checking. After "$Daemon::Generic::force_quit_delay * 4" seconds or 60 seconds (whichever is smaller), give up and exit(1). gd_install Installs the daemon so that it runs automatically at next reboot. Currently done with a symlink to $0 and "/usr/sbin/update-rc.d". Please send patches for other methods! gd_can_install Returns a function to do an "gd_install" if installation is possible. Returns 0 otherwise. gd_install_pre($method) Normal behavior: return. Called just before doing an installation. The method indicates the installation method (currently always "update-rc.d".) gd_install_post($method) Normal behavior: return. Called just after doing an installation. gd_uninstall Will remove the daemon from the automatic startup regime. gd_can_uninstall Returns a function to do the work for "gd_uninstall" if it's possible. 0 otherwise. gd_uninstall_pre($method) Normal behavior: return. Called just before doing an un-installation. The method indicates the installation method (currently always "update-rc.d".) gd_install_post($method) Normal behavior: return. Called just after doing an un-installation. MEMBER DATA Since you need to subclass Daemon::Generic, you need to know what the internal data structures for Daemon::Generic are. With two exceptions, all of the member data items begin with the prefix "gd_". configfile The location of the configuration file. (Not used by Daemon::Generic). debug Display debugging? (Not used by Daemon::Generic) gd_args The original %args passed to "new". gd_progname The process name. (defaults to $0) gd_pidfile The location of the process ID file. gd_logpriority Used for "logger -p". gd_foreground Are we running in the foreground? EXAMPLE PROGRAM my $sleeptime = 1; newdaemon( progname => 'ticktockd', pidfile => '/var/run/ticktockd.pid', configfile => '/etc/ticktockd.conf', ); sub gd_preconfig { my ($self) = @_; open(CONFIG, "<$self->{configfile}") or die; while() { $sleeptime = $1 if /^sleeptime\s+(\d+)/; } close(CONFIG); return (); } sub gd_run { while(1) { sleep($sleeptime); print scalar(localtime(time))."\n"; } } SEE ALSO With a while(1) and delayed signal delivery: Daemon::Generic::While1. With Event: Daemon::Generic::Event. With AnyEvent: Daemon::Generic::AnyEvent. Modules that use Daemon::Generic: SyslogScan::Daemon; IO::Event (rinetd.pl) Other modules that do similar things: Net::Daemon, Net::Server, Net::Server::Daemonize, NetServer::Generic, Proc::Application::Daemon, Proc::Daemon, Proc::Forking. LICENSE Copyright (C) 2006-2010 David Muir Sharnoff . Copyright (C) 2011 Google, Inc. This module may be used and distributed on the same terms as Perl itself. PACKAGERS Daemon::Generic is packaged for Fedora by Emmanuel Seyman . Daemon-Generic-0.85/META.json0000644000175000017500000000240013132503100014336 0ustar muirmuir{ "abstract" : "framework to provide start/stop/reload for a daemon", "author" : [ "David Muir Sharnoff " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142690", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Daemon-Generic", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "AnyEvent" : "0", "Eval::LineNumbers" : "0", "Event" : "0", "Time::HiRes" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Cwd" : "0", "File::Basename" : "0", "File::Flock" : "2013.06", "File::Slurp" : "0", "Getopt::Long" : "0", "Text::Wrap" : "0" } } }, "release_status" : "stable", "resources" : { "repository" : { "url" : "http://github.com/muir/Daemon-Generic" } }, "version" : 0.85 } Daemon-Generic-0.85/t/0000755000175000017500000000000013132503100013164 5ustar muirmuirDaemon-Generic-0.85/t/daemon.t0000644000175000017500000001114213132453757014641 0ustar muirmuir#!/usr/bin/perl -w use strict; use warnings; use Test::More qw(no_plan); use File::Temp qw(tempdir); use File::Slurp; use FindBin; use Time::HiRes; use Eval::LineNumbers qw(eval_line_numbers); my $finished; END { ok($finished, "finished"); } my $tmp = tempdir(); # $tmp = "/tmp/foo"; my $base = "$^X $tmp/daemon.pl -c $tmp/config"; write_file("$tmp/logger", <>", \$ENV{LOGGER_OUTPUT} or die "open >\$ENV{LOGGER_OUTPUT}: \$!"; select(\$out); \$| = 1; print \$out "START LOG \@ARGV\n"; while () { print \$out \$_; } END_LOGGER chmod(0755, "$tmp/logger") or die; $ENV{LOGGER_OUTPUT} = "$tmp/log"; $ENV{PATH} = "$tmp:$ENV{PATH}"; # diag read_file("$tmp/config"); my $daemon_header = eval_line_numbers(<<'END_HEADER'); #{ use strict; use warnings; use FindBin; use File::Slurp; use Time::HiRes qw(sleep); END_HEADER #} my $daemon_body = eval_line_numbers(<<'END_BODY'); #{ my $pid_file; my $counter_file; my $counter = 0; alarm(240); # just in case newdaemon(); my %c; sub gd_postconfig { my ($self, %config) = @_; %c = %config; } sub gd_run_body { if ($c{DIE}) { die $c{DIE}; } write_file($c{COUNTER}, "$counter\n"); $counter++; sleep($sleeptime) if $sleeptime; } my $rc = 0; sub gd_preconfig { my ($self) = @_; my %config; open my $fd, "<", $self->{configfile} or die "open $self->{configfile}: $!"; while (<$fd>) { chomp; next if /^$/; next if /^#/; next unless /^(.+?)=(.*)/; $config{$1} = $2; } $self->{gd_foreground} = $config{foreground}; $rc++; if ($config{RELOAD}) { write_file($config{RELOAD}, "$rc\n"); } if ($config{PATH}) { $ENV{PATH} = $config{PATH}; } return %config; } END_BODY #} setup_test(eval_line_numbers(<<'END_WHILE1')); use Daemon::Generic::While1; our @ISA = qw(Daemon::Generic::While1); my $sleeptime = 0.1; END_WHILE1 do_test('while1'); setup_test(eval_line_numbers(<<'END_EVENT'), 'sub gd_interval { 0.1 }' ); use Daemon::Generic::Event; our @ISA = qw(Daemon::Generic::Event); my $sleeptime = 0; END_EVENT do_test('event'); setup_test(eval_line_numbers(<<'END_ANYEVENT'), 'sub gd_interval { 0.1 }' ); use Event; use Daemon::Generic::AnyEvent; our @ISA = qw(Daemon::Generic::AnyEvent); my $sleeptime = 0; END_ANYEVENT do_test('anyevent'); $finished = 1; sub set_alarm { my ($pkg, $file, $line) = caller(1); $SIG{ALRM} = sub { die "timeout at $file line $line\n"; }; alarm(10); } sub expect (&) { set_alarm(); my $r; do { sleep(0.05); $r = $_[0]->() } while (! $r); alarm(0); return $r; } sub run { set_alarm(); my $r = `$base @_`; alarm(0); return $r; } sub setup_test { my ($head_frag, $body_frag) = @_; unlink "$tmp/$_" for qw(pid counter counter1 log); write_file("$tmp/daemon.pl", "use lib '$FindBin::Bin/../lib';\n", $daemon_header, $head_frag, $daemon_body, $body_frag || ''); config_deamon(); } sub config_deamon { write_file("$tmp/config", < 1 }; like(read_file("$tmp/log"), qr/Sucessfully daemonized/, "daemonized"); append_file("$tmp/config", "COUNTER=$tmp/counter2"); like(run('reload'), qr/reconfiguration/, "reconfig message"); expect { -s "$tmp/counter2" }; my $counter2 = read_file("$tmp/pid"); chomp($counter2); like($counter2, qr/^\d+$/, "counter2"); ok(kill(0,$pid), "process $pid is alive - $name"); my $check = run('check'); like($check, qr/Configuration looks okay/, "config ok - $name"); like($check, qr/running - pid \d+/, "running"); like(run('stop'), qr/Killing/, "kill message"); ok(!kill(0,$pid), "process is dead - $name"); my $check2 = run('check'); like($check2, qr/Configuration looks okay/, "config ok"); like($check2, qr/No \S+ running/, "not running"); like(run('restart'), qr/Starting/, "restart message - start - $name"); like(run('restart'), qr/Killing/, "restart message - kill"); like(run('restart'), qr/Starting/, "restart message - start - $name"); like(run('check'), qr/running - pid/, "check"); like(run('stop'), qr/Killing/, "stop message"); unlike(run('check'), qr/running - pid/, "check - $name"); } Daemon-Generic-0.85/Changes0000644000175000017500000000277213132503061014232 0ustar muirmuirRevision history for Perl module Daemon::Generic 0.85 2017/07/17 - Fixed a race condition in test. Bug 117927. 0.84 2013/10/04 - Replaced CHANGELOG with Changes - Typo fixes contributed by David Steinbrunner 0.83 2013/04/05 - Now using File::Flock::Forking so that locks are held on Solaris. Bug 83085. - Now using $self->{gd_progname} in all messages instead of $0. Bug 84439. - Added gd_kill_groups(). Bug 83294. - 'status' now says "No $0 running" if the pid file is missing. Bug 83295. - Defining gd_preconfig is now optional. Addresses bug 83086 - Added gd_reopen_output() to address bug 83087. - Fixed bug 80604: Typos in README 0.82 2012/03/07 - s/tmpdir/tmpdie/ 0.81 2011/07/26 - Add regression tests. - Add Daemon::Generic::AnyEvent 0.72 2011/05/19 - Address https://rt.cpan.org/Public/Bug/Display.html?id=63704, call setsid between forks rather than after them. - Address https://rt.cpan.org/Public/Bug/Display.html?id=58995, don't unexpand tabs. 0.71 2010/07/14 - Fix bug 58287 - close STDIN when daemonizing to complete the detach. 0.61 2009/04/04 - Stefan Seifert sent in a patch to make it LSB conformant. Note: start now exits with 0 if the daemon is already running. - scips noted an error in the example program. 0.51 2007/08/15 - Add File::Slurp dependency to Makefile.PL. Reported by Tom Lea . 0.4 2007/03/27 - Ronald J Kimball sent in a patch to avoid accidently clobbering $0. Daemon-Generic-0.85/Makefile.PL0000644000175000017500000000166712127716370014727 0ustar muirmuir require 5.008; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Daemon::Generic', DISTNAME => 'Daemon-Generic', VERSION_FROM => 'lib/Daemon/Generic.pm', dist => { COMPRESS => 'gzip', SUFFIX => 'gz' }, PREREQ_PM => { 'Getopt::Long' => 0, 'File::Flock' => 2013.06, 'File::Slurp' => 0, 'Text::Wrap' => 0, 'Cwd' => 0, 'File::Basename' => 0, }, BUILD_REQUIRES => { 'Time::HiRes' => 0, 'Event' => 0, 'AnyEvent' => 0, 'Eval::LineNumbers' => 0, }, ($] >= 5.005 ? ( ABSTRACT => 'framework to provide start/stop/reload for a daemon', AUTHOR => 'David Muir Sharnoff ', META_MERGE => { resources => { repository => 'http://github.com/muir/Daemon-Generic', }, }, ) : () ), ); package MY; sub postamble { <<'END_OF_POSTAMBLE'; pm_to_blib: README README: lib/Daemon/Generic.pod pod2text lib/Daemon/Generic.pod >README END_OF_POSTAMBLE } Daemon-Generic-0.85/META.yml0000644000175000017500000000134613132503100014176 0ustar muirmuir--- abstract: 'framework to provide start/stop/reload for a daemon' author: - 'David Muir Sharnoff ' build_requires: AnyEvent: '0' Eval::LineNumbers: '0' Event: '0' Time::HiRes: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142690' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Daemon-Generic no_index: directory: - t - inc requires: Cwd: '0' File::Basename: '0' File::Flock: '2013.06' File::Slurp: '0' Getopt::Long: '0' Text::Wrap: '0' resources: repository: http://github.com/muir/Daemon-Generic version: 0.85