From nobody Fri Jul 22 00:10:03 2022 X-Original-To: dev-commits-src-branches@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 4LpqZM2W6Nz4WgRD; Fri, 22 Jul 2022 00:10:03 +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 4LpqZM21psz3Ck2; Fri, 22 Jul 2022 00:10:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658448603; 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=qjMhM9+P+UkpQzVfDSnxbdXP+StC6QEn8AzqQ/y1erE=; b=eqZA3RvaYS9fdtMmdssbg4bxvfeASgs9D1a7JdNukFfLx25/mh4t7qIC8+a4+T11eWya2p JTcHn9xHlC3qCs74MOwKyNG9ZQpqjdh7+lgGjK/WRZnHiWMaLa8uv5o4rC++I4bDJon//f Eo7LuhbZQYNfYZ117zbHk3i7oQv/Rlc0WchJs5bTXOcb2UxrPvcy3pmNhLS39ziLYw8au0 HWSeEA18SFaTSlyJCQ3QmSmXV2dCnnURa+bgrqLCwTupl4McjoDDmuouA87eEx6p6HOsQ5 b58SkKSe2xa6ExeU7UrxyyqgJRkQ3LSuEZUwlMR/I1BRNhQKmEteQMkOxMRgOA== 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 4LpqZM153Vzh4y; Fri, 22 Jul 2022 00:10:03 +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 26M0A3Ms052016; Fri, 22 Jul 2022 00:10:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26M0A3Mj052013; Fri, 22 Jul 2022 00:10:03 GMT (envelope-from git) Date: Fri, 22 Jul 2022 00:10:03 GMT Message-Id: <202207220010.26M0A3Mj052013@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: 62cd401b90ea - stable/12 - rc.subr: Make sure oomprotect protects existing children List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/12 X-Git-Reftype: branch X-Git-Commit: 62cd401b90ea2597e446e17b9d76045cfec59770 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658448603; 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=qjMhM9+P+UkpQzVfDSnxbdXP+StC6QEn8AzqQ/y1erE=; b=hDSNBTzpDKdy/cY3qyICQDiTvj6GuSXTpvJ773x4J3iijVY3ol9p+lxQydneLQm42NxhFN /tBxLcKng9CHbCJK+NrAMlqfR2eHCYhNdGedMNjbkyQuvM4ZonX0M1z7QvDVCDYBdAHW+k sfXmaYubC4n0f9rPr0Rpgxemh17SGQnkaih5PXG38Ns2tBNmBU0ODpJNF2vQ1z4yHYDOiE wrqorFzBL57yZvDuBS0VM+eVQjP0Qv9arULWnp2PgdrI/N7d6f/FyIaf+wvj4Hr3g3AwIR RZ8bHCO4dqr5JSIMvqYyIjEins7Mrmfclu9sV+InzDGWAJa8E1hiKNp628YtSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658448603; a=rsa-sha256; cv=none; b=JksrHQDrsXRT6QajIMOB+a1s+x332R6wijTf1KxCnmZydNkmJeSKNuxx1KK6Nbc8RIKFnk NAyWVHCCGc1oiTM2O3k/gtp12udcofOsGY4vVPmvGa+4rsuuYyQBTI3hyWKrtwH5tLHZVa MvvidvxplwZcsXmG4cUztLndyzcf/GpirSMZiMtEpYuwBrXLO3QacuxDTS8YxUHH4zf56i UB4KbddWqT0EKJgyJ3YlEphkYxQp6LTufsKWHhZMw/e8/OzFDKye6/r9Pambgn+C1N1KCC fxLm84a+T2VyEwHbv1nAz4n70IkKLO8Xum8h3/ny8ZV90cClKdCf2wfgHCPuXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by 0mp (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=62cd401b90ea2597e446e17b9d76045cfec59770 commit 62cd401b90ea2597e446e17b9d76045cfec59770 Author: Mike Walker AuthorDate: 2022-07-07 20:28:37 +0000 Commit: Mateusz Piotrowski <0mp@FreeBSD.org> CommitDate: 2022-07-22 00:09:30 +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 77b26614fd11..c64186608aa2 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1263,7 +1263,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}