Skip to content

Instantly share code, notes, and snippets.

@nihen
Created February 10, 2010 06:19
Show Gist options
  • Save nihen/300080 to your computer and use it in GitHub Desktop.
Save nihen/300080 to your computer and use it in GitHub Desktop.
diff --git a/lib/Plack/Loader/Restarter.pm b/lib/Plack/Loader/Restarter.pm
index 4a79bbd..b072c16 100644
--- a/lib/Plack/Loader/Restarter.pm
+++ b/lib/Plack/Loader/Restarter.pm
@@ -23,6 +23,11 @@ sub watch {
sub _fork_and_start {
my($self, $server) = @_;
+ $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = sub {
+ $self->_kill_child;
+ exit;
+ };
+
my $pid = fork;
die "Can't fork: $!" unless defined $pid;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment