Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Jul 2022 06:20:27 GMT
From:      Mateusz Piotrowski <0mp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 68e035c0172b - main - rc.subr: Make sure oomprotect protects existing children
Message-ID:  <202207080620.2686KRte036007@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <mike.walker@napkindrawing.com>
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 <jamie@catflap.org>
    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}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207080620.2686KRte036007>