maxtime - run a command with a timeout
maxtime [-g] [-k] [-v] [-w] [--] time command [arg1 ...]
maxtime allows for an external program to be run with a time limit. The argument time must be a positive number of seconds, and may be fractional. If the command terminates within this period, maxtime reports its exit status. If the command's real (wall clock) time exceeds the time limit, it will be killed with SIGTERM. maxtime will then return the value 106 to indicate the timeout (see below under RETURN VALUE).
maxtime returns the exit status of the external command, unless an error condition occurs, in which case the exit code will be greater than 100.
Request the status of a Baan shared memory segment, but do not lock up if shared memory is corrupt:
maxtime 2 $BSE/bin/shmmanager6.1 -s
Allow at most 10 minutes for stopping a Baan software environment:
maxtime 600 $BSE/etc/rc.stop
If the time argument is omitted and an arg argument is provided, maxtime might interpret its commandline arguments wrong. This will only be apparent if -v has been used, or if its exit status is tested for value 105.
On some platforms, maxtime might confuse options for the external
command as options for itself. In these cases is necessary to indicate
the end of maxtime's options using --.
exit(3), setitimer(2), signal(7), wait(2).
This manual pertains to version 0.35.
This program is free software; you can redistribute it and/or modify it under the terms described by the GNU General Public License version 2.
maxtime is distributed without any warranty, even without the
implied warranties of merchantability or fitness for a particular purpose.