Austin Group Defect Tracker

Aardvark Mark IV

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
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:

     timeout – run a command with a time limit

     timeout [-k time] [-s sig] [--foreground] [--preserve-status] duration
             command [args]

     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.


             Do not propagate the timeout signal to children processes.

             Always exit with the same status as command, even if the timeout
             was reached.

     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

     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

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2022-05-14 22:07 steffen New Issue
2022-05-14 22:07 steffen Name => steffen
2022-05-14 22:07 steffen Section => Vol. 3: Shell and Utilities
2022-05-14 22:07 steffen Line Number => (Line or range of lines)

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker