]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
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 f594fad3960021386c106a87b3bc2f46a05aefaa..47997d4c84b06f516b76088d233ccc3f0bff1193 100755 (executable)
@@ -47,6 +47,10 @@ sub run_boot()
     my $bootcmd = scalar @ARGV ? "'".join("' '", @ARGV)."'" : "$FindBin::Bin/boot";
 
     $SIG{INT} = sub { kill_boot(); exit; };
     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: $!");
 
     pipe($boot, $wh) || die("pipe: $!");
     my $pid = fork() // die("fork: $!");