/usr/share/perl5/Catalyst/Restarter/Forking.pm is in libcatalyst-devel-perl 1.39-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | package Catalyst::Restarter::Forking;
use Moose;
extends 'Catalyst::Restarter';
has _child => (
is => 'rw',
isa => 'Int',
);
sub _fork_and_start {
my $self = shift;
if ( my $pid = fork ) {
$self->_child($pid);
}
else {
$self->start_sub->();
}
}
sub _kill_child {
my $self = shift;
return unless $self->_child;
return unless kill 0, $self->_child;
die "Cannot send INT signal to ", $self->_child, ": $!"
unless kill 'INT', $self->_child;
# If we don't wait for the child to exit, we could attempt to
# start a new server before the old one has given up the port it
# was listening on.
wait;
}
__PACKAGE__->meta->make_immutable;
1;
__END__
=head1 NAME
Catalyst::Restarter::Forking - Forks and restarts the child process
=head1 DESCRIPTION
This class forks and runs the server in a child process. When it needs
to restart, it kills the child and creates a new one.
=head1 SEE ALSO
L<Catalyst::Restarter>, L<Catalyst>, <File::ChangeNotify>
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm
=head1 COPYRIGHT
This program is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
|