From nobody Fri Jul 22 00:09:22 2022 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 4LpqYZ3RJLz4WgJ2; Fri, 22 Jul 2022 00:09:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LpqYZ305sz3CHF; Fri, 22 Jul 2022 00:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658448562; 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=OQbm/nxVG2m93V7qrhC3NrSiwBXz/Nbq1oXuF7Si/9Q=; b=r0pxswxHtb1k64hskjWwFTRWlgphPsOUYglP0A2sPq+CQhg+XVylrC9T4h7AFODhQyJAE3 3kWPlpQ+nDsYEML1hvlenFDgwwbphBo0aPuGhj0DuYV/8/UdRYhcoI835pp78o16MziLp7 8qv+hu15oilyCQslpnhj5VIGDtDbKMhjpEqTCMvw2Hy1UXXKSAN9kYj02KdykpuLotecmc ZhfpaYfMZAvhOSdi8aIS3rlhrA0kuIXKzWvO1A6xF1VEfRRJuvR21AZ8sMwd+z1f3wCphe FcHlygxAI+MvkoqFHyGjgU0MG7gAf/p21f0UM8BH8RJDSPd0aMbTVEiAfBcilA== 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 4LpqYZ2434zhCH; Fri, 22 Jul 2022 00:09:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26M09M2W049917; Fri, 22 Jul 2022 00:09:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26M09Mb0049915; Fri, 22 Jul 2022 00:09:22 GMT (envelope-from git) Date: Fri, 22 Jul 2022 00:09:22 GMT Message-Id: <202207220009.26M09Mb0049915@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 42422c5a4a50 - stable/13 - rc.subr: Make sure oomprotect protects existing children 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: 0mp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 42422c5a4a5035296b2c39c584b8cfc3aa6f4012 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658448562; 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=OQbm/nxVG2m93V7qrhC3NrSiwBXz/Nbq1oXuF7Si/9Q=; b=QMLMeaS1aJjlBDyJDYil3sKHYDdAUUD903BE5bybtQoWtNiR/l5KKR9oNeQhHyvmBHBLAD 20zSr15M9fq8oN595i+O9OH3bQqS2lzexp9j6+XIQKLocydfm6J/LdTEZz6/dFpj9Y7ebt KW3FwgGvpaU05QRYGyuAo7CE3s4hdy+a+wVg7iXIltO92+rYp13mwOpsY17r610mIMtEe7 o+4EV/x564mOdJTT7TSU3vniSyj1wYZ3aAaNDf1JqY/+zssij2kNUN1jm8oJ/2t/VPyOln rlUfAn60pW3jM8ol2gkQHNU5aVtnSI8/zvYlRubxiex8oz9p1pluzpFruOuJdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658448562; a=rsa-sha256; cv=none; b=md4ySuw0zl+Yh4iAYqZFPZ1ikNuKJtWxcCHlvXUU0k2rc+ugOI8NKUNedhAeBkVk679NW4 LAk5FBgFS3EUdny3YE3Nw3BUcgblAiBy0ZeWjVhuXbfqSX/TDmlkPItOBr3IZcPRpRLgtN uf/ptwdrieLMh2d2fruPkKkzpQGWdhPoYtt8x1cvVAjrca70HWpdsQjOVqknbs85A4/FAs szxd3/6o1FVICi+yLYM6MnmDqaRRUopjSSxbiveb5sHss+o8F82Us8Lf6fcwDVRJ1YMmh7 ole8fsjK1NWMvTf4xgik0V67pqRtPh5QZZkiIFXIX9G3YKi65S9HHXpqasTQEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=42422c5a4a5035296b2c39c584b8cfc3aa6f4012 commit 42422c5a4a5035296b2c39c584b8cfc3aa6f4012 Author: Mike Walker AuthorDate: 2022-07-07 20:28:37 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2022-07-22 00:09:10 +0000 rc.subr: Make sure oomprotect protects existing children The rc(8) framework support protecting services from OOM killer. The current implementation applies the protection after the service has already started. This works fine if only the main process is to be protected (*_oomprotect=yes). However, the current implementation fails to protect existing children when children are also to be protected (*_oomprotect=all). This patch fixes that. Note: it is not easy to apply the protectoin earlier because we want to support both the services which use the "command" variable and those that use the "start_cmd" variable. PR: 256148 Approved by: adrian, osogbo Tested by: Jamie Landeg-Jones Fixes: 3bead71e959d - Add a global option where we can protect MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D35747 (cherry picked from commit 68e035c0172b441db772de41ad0f8977679bfedc) --- libexec/rc/rc.subr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index b027fa5facf4..df91737566d5 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1275,7 +1275,7 @@ $command $rc_flags $command_args" [ -z "${rc_pid}" ] && eval $_pidcmd case $_oomprotect in [Aa][Ll][Ll]) - ${PROTECT} -i -p ${rc_pid} + ${PROTECT} -d -i -p ${rc_pid} ;; [Yy][Ee][Ss]) ${PROTECT} -p ${rc_pid}