Page MenuHomeFreeBSD

rc.subr: Make sure oomprotect protects existing children
ClosedPublic

Authored by 0mp on Jul 7 2022, 8:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 11:46 AM
Unknown Object (File)
Sun, Nov 3, 11:30 PM
Unknown Object (File)
Oct 9 2024, 8:59 PM
Unknown Object (File)
Sep 18 2024, 8:20 AM
Unknown Object (File)
Sep 18 2024, 12:28 AM
Unknown Object (File)
Sep 17 2024, 7:45 AM
Unknown Object (File)
Sep 16 2024, 5:40 PM
Unknown Object (File)
Sep 15 2024, 4:04 AM
Subscribers

Details

Summary

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
Co-authored-by: Mike Walker <mike.walker@napkindrawing.com>
Tested by: Jamie Landeg-Jones <jamie@catflap.org>
Fixes: 3bead71e959d - Add a global option where we can protect
MFC after: 1 week

Test Plan

The tests are implemented here: https://reviews.freebsd.org/D35745

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

0mp requested review of this revision.Jul 7 2022, 8:38 PM
adrian added a subscriber: adrian.

hey nice catch!

This revision is now accepted and ready to land.Jul 7 2022, 9:36 PM

The change LGTM.
That said I would suggest committing this as submited by: Mike Walker, not as a co-authored as he did the heavy lifting in this change.