DaemonDebug (Chapter 14)

The DaemonDebug module exports the same functions as the Daemon module described in Chapter 14. However, it remains in the foreground and leaves standard error open. This makes it easier to debug with during development.

 0 package DaemonDebug; 1 use strict; 2 use vars qw(@EXPORT @ISA @EXPORT_OK $VERSION); 3 use POSIX qw(:signal_h WNOHANG); 4 use Carp 'croak','cluck'; 5 use File::Basename; 6 use IO::File; 7 require Exporter; 8 @EXPORT_OK = qw(init_server prepare_child kill_children 9 launch_child do_relaunch 10 log_debug log_notice log_warn 11 log_die %CHILDREN); 12 @EXPORT = @EXPORT_OK; 13 @ISA = qw(Exporter); 14 $VERSION = '1.00'; 15 use constant PIDPATH => '/tmp'; 16 use vars '%CHILDREN'; 17 my ($pid,$pidfile,$saved_dir,$CWD); ...

Get Network Programming with Perl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.