b706edf6bed74afdd6defdf440f8864fbba24ab1
[mkws-moved-to-github.git] / test / bin / bomb
1 #!/bin/bash
2 # Copyright (c) 2014 Index Data ApS. http://indexdata.com
3 #
4 # bomb - wrapper to stop a process after N seconds
5
6 # Turn on job control. This will switch the process group
7 # as on an interactive shell, and make sure that a signal
8 # to the process group will not kill any parent processes.
9 set -o monitor
10
11 # the maximum amount of cpu time in seconds
12 # last resort if BSD::Resource is not available in ./bomb.pl
13 ulimit -t 120
14
15 # now run the perl script. For unknown reasons, the
16 # call to setpgrp() in perl does not work as expected,
17 # and we solve the issue by this simple shell wrapper
18
19 perl $0.pl "$@"
20
21 # EOF