Rechercher une page de manuel

Chercher une autre page de manuel:


Langue: en

Autres versions - même langue

Version: 312237 (ubuntu - 07/07/09)

Section: 1 (Commandes utilisateur)

BSD mandoc


timelimit - effectively limit the absolute execution time of a process


[-q ] [-S killsig ] [-s warnsig ] [-T killtime ] [-t warntime ] command [arguments ... ]


The utility executes a given command with the supplied arguments and terminates the spawned process after a given time with a given signal. If the process exits before the time limit has elapsed, will silently exit, too.


Quiet operation - does not output diagnostic messages about signals sent to the child process.
-S killsig
Specify the number of the signal to be sent to the process killtime seconds after warntime has expired. Defaults to 9 (SIGKILL).
-s warnsig
Specify the number of the signal to be sent to the process warntime seconds after it has been started. Defaults to 15 (SIGTERM).
-T killtime
Specify the maximum execution time of the process before sending killsig after warnsig has been sent. Defaults to 120 seconds.
-t warntime
Specify the maximum execution time of the process in seconds before sending warnsig Defaults to 3600 seconds.


The killsig to use if the -S option was not specified.
The killtime to use if the -T option was not specified.
The warnsig to use if the -s option was not specified.
The warntime to use if the -t option was not specified.


If the child process exits normally, the utility will pass its exit code on up. If the child process is terminated by a signal, the utility's exit status is 128 plus the signal number, similar to sh(1).

In rare cases, the utility may encounter a system or user error; then, its exit status is one of the standard sysexits(3) values:

The command-line parameters and options were incorrectly specified.
The utility itself received an unexpected signal while waiting for the child process to terminate.
The utility was unable to execute the child process, wait for it to terminate, or examine its exit status.


The following examples are shown as given to the shell:

timelimit /usr/local/bin/rsync rsync:// /opt/mirror

Run the rsync program to mirror a WWW or FTP site and kill it if it runs longer than 1 hour (that is 3600 seconds) with SIGTERM. If the rsync process does not exit after receiving the SIGTERM, issues a SIGKILL 120 seconds after the SIGTERM.

tcpserver 0 8888 timelimit -t600 -T300 /opt/services/chat/stats

Start a tcpservern process listening on tcp port 8888; each client connection shall invoke an instance of an IRC statistics tool under /opt/services/chat and kill it after 600 seconds have elapsed. If the stats process is still running after the SIGTERM, it will be killed by a SIGKILL sent 300 seconds later.

env WARNTIME=600 WARNSIG=1 KILLTIME=30 timelimit sh

Start a shell script and kill it with a SIGHUP in 600 seconds. If the shell gets stuck and does not respond to the SIGHUP, kill it with the default SIGKILL after 30 more seconds.


kill(1), rsync(1), signal(3), tcpservern


No standards documentation was harmed in the process of creating .


Please report any bugs in to the author.


The utility was conceived and written by An Peter Pentchev Aq with contributions by An Karsten W Rohrbach Aq .
L'homme est le seul mâle qui batte sa femelle. On doit donc en déduire
que l'homme est le plus brutal des mâles... a moins que la femme ne
soit, de toutes les femelles, la plus insupportable.
-+- Georges Courteline -+-