1 package MooseX::Daemonize::Core;
2 use strict; # because Kwalitee is pedantic
15 sub daemon_fork { Proc::Daemon::Fork }
16 sub daemon_detach { Proc::Daemon::Init }
20 return if $self->daemon_fork;
30 MooseX::Daemonize::Core - provides a Role the core daemonization features
44 If true, the process is the backgrounded process. This is useful for example
45 in an after 'start' => sub { } block
59 Calls C<Proc::Daemon::Init> to daemonize this process.
63 Setup the signal handlers, by default it only sets up handlers for SIGINT and SIGHUP
67 Handle a INT signal, by default calls C<$self->stop()>
71 Handle a HUP signal. By default calls C<$self->restart()>
75 The C<meta()> method from L<Class::MOP::Class>
81 =for author to fill in:
82 A list of all the other modules that this module relies upon,
83 including any restrictions on versions, and an indication whether
84 the module is part of the standard Perl distribution, part of the
85 module's distribution, or must be installed separately. ]
87 Obviously L<Moose>, and L<Proc::Daemon>
89 =head1 INCOMPATIBILITIES
91 =for author to fill in:
92 A list of any modules that this module cannot be used in conjunction
93 with. This may be due to name conflicts in the interface, or
94 competition for system or program resources, or due to internal
95 limitations of Perl (for example, many modules that use source code
96 filters are mutually incompatible).
101 =head1 BUGS AND LIMITATIONS
103 =for author to fill in:
104 A list of known problems with the module, together with some
105 indication Whether they are likely to be fixed in an upcoming
106 release. Also a list of restrictions on the features the module
107 does provide: data types that cannot be handled, performance issues
108 and the circumstances in which they may arise, practical
109 limitations on the size of data sets, special cases that are not
112 No bugs have been reported.
114 Please report any bugs or feature requests to
115 C<bug-acme-dahut-call@rt.cpan.org>, or through the web interface at
116 L<http://rt.cpan.org>.
120 L<Proc::Daemon>, L<Daemon::Generic>, L<MooseX::Getopt>
124 Chris Prather C<< <perigrin@cpan.org> >>
128 Mike Boyko, Matt S. Trout, Stevan Little, Brandon Black, Ash Berlin and the
131 Some bug fixes sponsored by Takkle Inc.
133 =head1 LICENCE AND COPYRIGHT
135 Copyright (c) 2007, Chris Prather C<< <perigrin@cpan.org> >>. All rights
138 This module is free software; you can redistribute it and/or
139 modify it under the same terms as Perl itself. See L<perlartistic>.
142 =head1 DISCLAIMER OF WARRANTY
144 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
145 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
146 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
147 PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
148 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
149 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
150 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
151 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
152 NECESSARY SERVICING, REPAIR, OR CORRECTION.
154 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
155 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
156 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE
157 LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL,
158 OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
159 THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
160 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
161 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
162 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF