projects
/
mkws-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sleep a little bit between sending signals to childs
[mkws-moved-to-github.git]
/
test
/
bin
/
bomb.pl
diff --git
a/test/bin/bomb.pl
b/test/bin/bomb.pl
index
a84f40b
..
5671a53
100755
(executable)
--- a/
test/bin/bomb.pl
+++ b/
test/bin/bomb.pl
@@
-1,4
+1,4
@@
-#!/usr/local/bin/perl
+#!/usr/bin/perl
# Copyright (c) 2014 IndexData ApS. http://indexdata.com
#
# bomb.pl - wrapper to stop a process after N seconds
# Copyright (c) 2014 IndexData ApS. http://indexdata.com
#
# bomb.pl - wrapper to stop a process after N seconds
@@
-28,17
+28,16
@@
sub set_alarm {
warn "Time out alarm $time\n";
# sends a hang-up signal to all processes in the current process group
warn "Time out alarm $time\n";
# sends a hang-up signal to all processes in the current process group
- # and kill running java processes
local $SIG{HUP} = "IGNORE";
kill 1, -$$;
local $SIG{HUP} = "IGNORE";
kill 1, -$$;
+ sleep 0.2;
local $SIG{TERM} = "IGNORE";
kill 15, -$$;
local $SIG{TERM} = "IGNORE";
kill 15, -$$;
+ sleep 0.2;
kill 15, -$$;
warn "Send a hang-up to all childs.\n";
kill 15, -$$;
warn "Send a hang-up to all childs.\n";
-
- #exit 1;
};
warn "set alarm time to: $time seconds $message\n" if $debug >= 1;
};
warn "set alarm time to: $time seconds $message\n" if $debug >= 1;
@@
-57,7
+56,7
@@
EOF
GetOptions(
"help" => \$help,
"debug=i" => \$debug,
GetOptions(
"help" => \$help,
"debug=i" => \$debug,
- "timeout=i" => \$timeout,
+ "timeout=f" => \$timeout,
) or die usage;
my @system = @ARGV;
) or die usage;
my @system = @ARGV;
@@
-68,6
+67,6
@@
die usage if !@system;
set_alarm( $timeout, join( " ", @system ) );
system(@system) == 0
set_alarm( $timeout, join( " ", @system ) );
system(@system) == 0
- or die "system @system failed: $?";
+ or die "@system failed with exit code: $?\n";
exit(0);
exit(0);