Anonymous | Login | 2022-06-30 22:18 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | Category | Severity | Type | Date Submitted | Last Update | |||||||
0001586 | [1003.1(2016/18)/Issue7+TC2] Shell and Utilities | Editorial | Enhancement Request | 2022-05-14 22:07 | 2022-05-14 22:07 | |||||||
Reporter | steffen | View Status | public | |||||||||
Assigned To | ||||||||||||
Priority | normal | Resolution | Open | |||||||||
Status | New | |||||||||||
Name | steffen | |||||||||||
Organization | ||||||||||||
User Reference | ||||||||||||
Section | Vol. 3: Shell and Utilities | |||||||||||
Page Number | ||||||||||||
Line Number | (Line or range of lines) | |||||||||||
Interp Status | --- | |||||||||||
Final Accepted Text | ||||||||||||
Summary | 0001586: timeout - new utility: run a command with a time limit | |||||||||||
Description |
As of today it is very complicated to reliably run a program from within a sh(1)ell with a timeout, a sh(1)ell can only hardly kill a child after a timeout without introducing a race, as shown in issue #1585. All modern operating systems (to my knowledge) therefore ship a timeout(1) command for some time, which can be used to reliably run a program with a timeout set. |
|||||||||||
Desired Action |
Add the timeout utility. Here is the current manual page as present on OpenBSD, taken from FreeBSD, under 2-clause BSD license: NAME timeout – run a command with a time limit SYNOPSIS timeout [-k time] [-s sig] [--foreground] [--preserve-status] duration command [args] DESCRIPTION The timeout utility executes command, with any args, and kills it if it is still running after the specified duration. If duration is 0, the timeout is disabled. The options are as follows: -k time Send a second signal, SIGKILL, if the command is still running time after the first signal was sent. SIGTERM. --foreground Do not propagate the timeout signal to children processes. --preserve-status Always exit with the same status as command, even if the timeout was reached. DURATION FORMAT duration and time may contain a decimal fraction. The value defaults to seconds unless a unit suffix is given. The supported unit suffixes are: s seconds m minutes h hours d days EXIT STATUS If the timeout was not reached or --preserve-status was set, the exit status of command is returned. If the timeout was reached and --preserve-status was not set, an exit status of 124 is returned. If command exited after receiving a signal, the exit status returned is the signal number plus 128. |
|||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
|
There are no notes attached to this issue. |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |