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)
Jan 3 2024, 4:27 AM
Unknown Object (File)
Dec 20 2023, 6:40 AM
Unknown Object (File)
Dec 19 2023, 11:44 PM
Unknown Object (File)
Nov 25 2023, 11:10 AM
Unknown Object (File)
Nov 22 2023, 9:22 PM
Unknown Object (File)
Nov 22 2023, 4:06 PM
Unknown Object (File)
Nov 22 2023, 12:42 PM
Unknown Object (File)
Nov 14 2023, 3:12 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.