Commit cc529b83 authored by Mike Hibler's avatar Mike Hibler

If HUP/INT/TERM'ed, make sure we kill off child frisbee and remove any

partial image.
parent 7527ad9d
......@@ -144,8 +144,17 @@ if ($debug) {
print "$FRISBEE -N -i $mcastif -m $loadaddr -p $loadport $filename\n";
}
$SIG{HUP} = $SIG{INT} = $SIG{TERM} = \&cleanup;
system("$FRISBEE -N -i $mcastif -m $loadaddr -p $loadport $filename");
if ($?) {
tbdie("Error downloading image data from outer Emulab!");
}
exit(0);
sub cleanup {
tbwarn("Download interrupted, $filename removed");
$SIG{HUP} = $SIG{INT} = $SIG{TERM} = 'IGNORE';
kill('TERM', 0);
unlink($filename);
exit(-1);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment