continuous: Kill the boot process when various signals are received
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 10 Apr 2014 16:33:18 +0000 (18:33 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 10 Apr 2014 16:33:18 +0000 (18:33 +0200)
This is needed when run.pl is run under timeout utility. It sends the TERM
signal to the children.

continuous/gw-setup/run.pl

index f594fad..47997d4 100755 (executable)
@@ -47,6 +47,10 @@ sub run_boot()
     my $bootcmd = scalar @ARGV ? "'".join("' '", @ARGV)."'" : "$FindBin::Bin/boot";
 
     $SIG{INT} = sub { kill_boot(); exit; };
+    $SIG{HUP} = sub { kill_boot(); exit; };
+    $SIG{ALRM} = sub { kill_boot(); exit; };
+    $SIG{TERM} = sub { kill_boot(); exit; };
+    $SIG{QUIT} = sub { kill_boot(); exit; };
 
     pipe($boot, $wh) || die("pipe: $!");
     my $pid = fork() // die("fork: $!");