maxtime is a C program that runs a shell command you give it on the command line. It runs the program up to a user-specified number of seconds, prior to attempting to kill the subprocess. If the subprogram won't die (say, due to an NFS timeout or something), then maxtime will leave lots of deadly signals waiting for the subprogram when it wakes up, and meanwhile maxtime will exit, as though the subprogram had died like it was supposed to, leaving the subprogram in the background. The subprogram may still be stuck, but your shell script can continue.

The included Makefile has a "make test" target.

  • This software is owned by The university of California, Irvine, and is not distributed under any version of the GPL. GPL is a fine series of licenses, but the owners of the software need it to be distributed under these terms.

    You can download it here.

    It turns out there's a bash-specific (?) way of doing a maxtime-like timeout without requiring any extra programs:

    Hits: 3703
    Timestamp: 2024-03-01 13:01:52 PST

    Back to Dan's tech tidbits

    You can e-mail the author with questions or comments: