Skip to content

Commit

Permalink
improved Hypnotoad to clean up old PID files (closes #383)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 15, 2012
1 parent 9ffbec7 commit fb3d704
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,5 +1,6 @@

3.42 2012-09-14
3.42 2012-09-15
- Improved Hypnotoad to clean up old PID files.
- Improved documentation.

3.41 2012-09-13
Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/Server/Hypnotoad.pm
Expand Up @@ -82,8 +82,9 @@ sub run {
$self->{poll} = IO::Poll->new;
$self->{poll}->mask($self->{reader}, POLLIN);

# Manager environment
# Clean manager environment
my $c = $self->{config};
unlink $c->{pid_file} if $ENV{HYPNOTOAD_REV} < 3 && -w $c->{pid_file};
$SIG{INT} = $SIG{TERM} = sub { $self->{finished} = 1 };
$SIG{CHLD} = sub {
while ((my $pid = waitpid -1, WNOHANG) > 0) { $self->_reap($pid) }
Expand Down

0 comments on commit fb3d704

Please sign in to comment.