From owner-svn-src-head@freebsd.org Thu Mar 29 02:13:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EAAF65BF9; Thu, 29 Mar 2018 02:13:59 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFB43713A5; Thu, 29 Mar 2018 02:13:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAA8113786; Thu, 29 Mar 2018 02:13:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2T2DwGS057806; Thu, 29 Mar 2018 02:13:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2T2DwPl057805; Thu, 29 Mar 2018 02:13:58 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803290213.w2T2DwPl057805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 29 Mar 2018 02:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331720 - head/usr.bin/timeout X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/timeout X-SVN-Commit-Revision: 331720 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2018 02:13:59 -0000 Author: cem Date: Thu Mar 29 02:13:58 2018 New Revision: 331720 URL: https://svnweb.freebsd.org/changeset/base/331720 Log: timeout.1: Try to improve clarity Minor rewordings, markup fixes or enhancements, and some typo fixes. Add a few sentences clarifying the special zero duration. PR: 227012 Submitted by: Mateusz Piotrowski (0mp@) (earlier version) Modified: head/usr.bin/timeout/timeout.1 Modified: head/usr.bin/timeout/timeout.1 ============================================================================== --- head/usr.bin/timeout/timeout.1 Thu Mar 29 01:20:58 2018 (r331719) +++ head/usr.bin/timeout/timeout.1 Thu Mar 29 02:13:58 2018 (r331720) @@ -1,3 +1,5 @@ +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" .\" Copyright (c) 2014 Baptiste Daroussin .\" All rights reserved. .\" @@ -24,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 20, 2017 +.Dd March 28, 2018 .Dt TIMEOUT 1 .Os .Sh NAME @@ -36,40 +38,47 @@ .Op Fl -preserve-status .Op Fl -kill-after Ar time | Fl k Ar time .Op Fl -foreground -.Ao Ar duration Ac -.Ao Ar command Ac -.Ao Ar args ... Ac +.Ar duration +.Ar command +.Op Ar args ... .Sh DESCRIPTION .Nm starts the .Ar command with its -.Ar args. -If +.Ar args . +If the .Ar command is still running after .Ar duration , it is killed. By default, -.Ar SIGTERM. +.Dv SIGTERM is sent. -.Bl -tag -width "-k time, --kill-after time" +The special +.Ar duration , +zero, signifies no limit. +Therefore a signal is never sent if +.Ar duration +is 0. +.Pp +The options are as follows: +.Bl -tag -width indent .It Fl -preserve-status -Always exits with the same status as -.Ar command -even if it times out. +Exit with the same status as +.Ar command , +even if it times out and is killed. .It Fl -foreground -Do not propagate timeout to the -.Ar command -children. +Do not propagate timeout to the children of +.Ar command . .It Fl s Ar sig , Fl -signal Ar sig Specify the signal to send on timeout. By default, -.Ar SIGTERM . +.Dv SIGTERM is sent. .It Fl k Ar time , Fl -kill-after Ar time Send a -.Ar SIGKILL +.Dv SIGKILL signal if .Ar command is still running after @@ -80,18 +89,19 @@ after the first signal was sent. .Ar duration and .Ar time -can be integer or decimal numbers. -Values without unit symbols are interpreted as seconds. +are non-negative integer or real (decimal) numbers, with an optional +unit-specifying suffix. +Values without an explicit unit are interpreted as seconds. .Pp Supported unit symbols are: .Bl -tag -width indent -compact -.It s +.It Cm s seconds -.It m +.It Cm m minutes -.It h +.It Cm h hours -.It d +.It Cm d days .El .Sh EXIT STATUS @@ -115,17 +125,17 @@ plus 128. .Pp If .Ar command -is an invalid command, the exit status returned is 126. +refers to a non-existing program, the exit status returned is 127. .Pp If .Ar command -is a non existing command, the exit status returned is 127. +is an otherwise invalid program, the exit status returned is 126. .Pp If an invalid parameter is passed to .Fl s or .Fl k , -the exit status return is 125. +the exit status returned is 125. .Sh SEE ALSO .Xr kill 1 , .Xr signal 3