From nobody Fri Jul 08 06:20:27 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 AA38F12DC49E; Fri, 8 Jul 2022 06:20:27 +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 4LfNSC4RHcz3d1j; Fri, 8 Jul 2022 06:20:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657261227; 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=T1sc4/Vrg+1ZgEH6MUetoZCi0Q+jBFEpinDhWYXugCM=; b=mZE1X+BhJh8fIB8nWC31MXL6VXmOOaNSTeX1PWz4zAaz0SaH40VbGGtvwnIIGxUoEAt2hq HLn7Yg4WrRWekNo3116CgIfvgtFsUF1wjRkuE58Y3LP6rFgrPLjC5bh8tJ7CXcIssznTpj nvfPqYeuGJmnureY+Cz46CryO/5PA+tR/l/A+i5hnVTGPsuiB49DFS1DuMp559YZ+9OO2T xZfLdVzyBLHG4PU8kpnA71ty1mvbct1QvhA7V826KAqKu/vOc88ir2yMkoTfzISN1wxJDq G4A8ht5UXR/bPI9uVWqcP37lKv+cmaaw1+b0pMbI3+MFXOxtnGzEz0SLACuJLA== 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 4LfNSC3W8Gz1BbZ; Fri, 8 Jul 2022 06:20:27 +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 2686KRUF036008; Fri, 8 Jul 2022 06:20:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2686KRte036007; Fri, 8 Jul 2022 06:20:27 GMT (envelope-from git) Date: Fri, 8 Jul 2022 06:20:27 GMT Message-Id: <202207080620.2686KRte036007@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Piotrowski <0mp@FreeBSD.org> Subject: git: 68e035c0172b - main - 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/main X-Git-Reftype: branch X-Git-Commit: 68e035c0172b441db772de41ad0f8977679bfedc Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657261227; 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=T1sc4/Vrg+1ZgEH6MUetoZCi0Q+jBFEpinDhWYXugCM=; b=UD/VeJ0DC00omLkpf7TCI3PoPsl2ZVsTO9nYPYja3AyZMStertNcsEqnV9eeLG7UVk82xp kM5OgcSULSzmy5Erbqw9dwJt85oNbelwoxgUVAmXWY2cKbIL1VH/oBvonvBp1DGBnzBtOK pNbM8c5ai4gplN1GkqZXP6RBYrKkeNv8RkZjDghPnXpDjp1em+NzhZNVO6Ra1pHpM9yYLL fsHcm/1Qie9Dq+IjNiFFhl/LHndymJGjmNfiGFngXi2GHSOgY8tUFKwFVD7S1rxM4ubOmC 9MM384K9+hnGVzNrqk6ehhv//B67zS4U74cxU25MQub6l2FzGioyjG+y9Gy6cA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657261227; a=rsa-sha256; cv=none; b=BwgFpsuuO6LI3S+jwVPKm6WWk7YuTWKDhQhoe4IAPOkWCE3xYv2RiUQERU6eFBX8Z0GsxK b76txP5NCssZiZTiaX3pjDREd+eoO9sgdQnC0rDYC9q8T907PMer6cInTh5smM78pzUtQC IXqGqUzhjhQhs0VaEUk473WgNVwnfPkmbzfol7r8XPRttXMnb6tsFDhcvbgbgLBx5MCaqF i+oHgOwclz99hLGyfBL9my8OCGrCjchzhbbnNNujSoNfwE3aw6ouRq5UCAEXmg1d7SoUPE COyseRTFJc7Dqrb/Rju1IItW1xCzK2q7I/eUS9LFjQWOwjh5rfVc+xAzwlTpmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=68e035c0172b441db772de41ad0f8977679bfedc commit 68e035c0172b441db772de41ad0f8977679bfedc Author: Mike Walker AuthorDate: 2022-07-07 20:28:37 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2022-07-08 06:19:50 +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 --- 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 dc4f49612c29..99d1711e16ab 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1289,7 +1289,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}