From nobody Mon Jun 16 08:54:10 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bLP1v3FZXz5VpT9; Mon, 16 Jun 2025 08:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1v0y28z3wgJ; Mon, 16 Jun 2025 08:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t6xMhPRHF6P2v2tJQgkK+Mp74WJMnQedljGHAE/Y3Ps=; b=ocOWeg+mBjv7s3dekMEF4oidfLcMoObb7kdml++/YGQUVt6nqnxAbQzZ7qmOgkvjq6o48h iTcxpTUQvHraG7O8LyGCEinqes5Fjd5KBA2EcCmsfvUsCKAlySSX8NFzeXqfzTH9w0VF5Q TCvyZyHhLhdwX7rPzXsTZPG/LFU+JXczfXFC/4brCwEpZgSnY5Rau4F3V0XWOXieQdYmxE UIWcIa7L87ZA1ritAmZFi6jW/c3RXpcY7TQamMegkfP8/CtfWZQIi7lmleI60QbAVYiM2H 4GXcH2nryVIjmlqEBbjnkHk8/zjzYQdZxCrQ25QSbsei5TpYCrHSBrGGid/J0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=t6xMhPRHF6P2v2tJQgkK+Mp74WJMnQedljGHAE/Y3Ps=; b=yx2ssCRqdK/Sil530nEZZQcK7+uq4qKulneHxM+/y03+lG/luSq0j8CMFwhFuxgD7OkLvT fGOLi4O6PYWRXLrZcXw3fN4GAP5UDHqSEGBYaw7z4Q9Srm1amwZTm1vv4heOX1FNhl0CgF cAzHL3SkTY2eLn3hmYmEabRdI4vqVhPCxlmt5dpGEP7n0TVWQCNA65E2pUnpAEOc4PFLk8 mwMnvyzMiQi3HEl1aY4M9kvIfGfcWqMNThqFGxpNgRht51/cJhQV0p2MDfS11KnmZNlGrp 4BiH6L6bo3Os2C6iiAL1mf+BFo4vVQMUFSSYPU8z4xITwyxYhR/maXgGuF4QWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064051; a=rsa-sha256; cv=none; b=ywA3Z0+7AHBT2Ua1PmUZShYqH+jrXyA7IvEsx1IN3qyyvrZ9sj0DoMg3g+f/uiIveoufX5 kTApHev+L5RnMCs69w99N/6WO5OzulLrBhL4mWV9A5SwMKgZCLMGMY+orxGRekRHfklZbN bko/fwrs/2xE0RN7Lw8STFsBgusJDIaZ7D11yohO+0CfrLwp/uOkNXws7KI6gacojtCGWt qdyuustNNVU7q9PIzJG4geJHziKwiGIK4P5JNmxhhNiolt/7jtsCp0e908CiJ6v6aCW2Kb Cxa7fnkNM9brjtKkEDIBayKGRfKQtuEFDJLtdBK9JNldoxjy/UG2b8f9wxxfZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bLP1t6HpKzrtF; Mon, 16 Jun 2025 08:54:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55G8sAOG043524; Mon, 16 Jun 2025 08:54:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8sALA043521; Mon, 16 Jun 2025 08:54:10 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:10 GMT Message-Id: <202506160854.55G8sALA043521@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 91dc8fcff090 - stable/14 - timeout(1): Document the reaper implementation and behaivor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 91dc8fcff09013ee44f72ee2c202466cb446afcb Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=91dc8fcff09013ee44f72ee2c202466cb446afcb commit 91dc8fcff09013ee44f72ee2c202466cb446afcb Author: Aaron LI AuthorDate: 2025-04-03 02:54:49 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:53 +0000 timeout(1): Document the reaper implementation and behaivor (cherry picked from commit c362781c8d6a878ac93f3debc45d401bd5296eee) --- bin/timeout/timeout.1 | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index 43a484dac76f..6486ccf99a36 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -1,6 +1,7 @@ .\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2014 Baptiste Daroussin +.\" Copyright (c) 2025 Aaron LI .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -101,6 +102,9 @@ The options are as follows: Only time out the .Ar command itself, but do not propagate signals to its descendants. +See the +.Sx IMPLEMENTATION NOTES +section for more details. .It Fl k Ar time , Fl -kill-after Ar time Send a .Dv SIGKILL @@ -145,6 +149,30 @@ hours .It Cm d days .El +.Sh IMPLEMENTATION NOTES +If the +.Fl -foreground +option is not specified, +.Nm +runs as the reaper (see also +.Xr procctl 2 ) +of the +.Ar command +and its descendants, and will wait for all the descendants to terminate. +This behavior might cause surprises if there are descendants running +in the background, because they will ignore +.Dv SIGINT +and +.Dv SIGQUIT +signals. +For example, the following command that sends a +.Dv SIGTERM +signal will complete in 2 seconds: +.Dl $ timeout -s TERM 2 sh -c 'sleep 4 & sleep 5' +However, this command that sends a +.Dv SIGINT +signal will complete in 4 seconds: +.Dl $ timeout -s INT 2 sh -c 'sleep 4 & sleep 5' .Sh EXIT STATUS If the time limit was reached and the .Fl -preserve-status @@ -247,9 +275,9 @@ The command first appeared in .Fx 10.3 . .Pp -The +The initial .Fx -work is compatible with GNU +work was compatible with GNU .Nm by .An Padraig Brady , @@ -258,6 +286,7 @@ The .Nm utility first appeared in GNU Coreutils 7.0. .Sh AUTHORS -.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org -and +.An Baptiste Daroussin Aq Mt bapt@FreeBSD.org , .An Vsevolod Stakhov Aq Mt vsevolod@FreeBSD.org +and +.An Aaron LI Aq Mt aly@aaronly.me