opnsense-src/libexec/rc
Mike Walker 42422c5a4a 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:		3bead71e95 - Add a global option where we can protect
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35747

(cherry picked from commit 68e035c017)
2022-07-22 02:09:10 +02:00
..
rc.d rc: Fix quoting in the zpoolreguid script 2022-07-19 09:49:49 -04:00
Makefile Revert r359294 per manu's request 2020-03-25 08:35:55 +00:00
netstart
network.subr rc: network.subr improve network6_getladdr() 2021-12-29 16:01:46 +00:00
pccard_ether
rc Replace literal uses of /usr/local with a variable 2020-11-03 12:29:10 +00:00
rc.bsdextended pkgbase: Really move rc.bsdextended 2019-05-22 07:39:59 +00:00
rc.conf rc: Add a zpoolreguid rc.d script 2022-07-19 09:49:44 -04:00
rc.firewall rc.firewall: Merge two identical conditions into one. 2020-07-23 15:03:28 +00:00
rc.initdiskless Make mdmfs verbose if diskless boot is verbose. 2019-04-26 14:44:50 +00:00
rc.resume rcorder(8): add support for /etc/rc.resume, so it calls "rcorder -k resume" 2018-10-27 17:21:13 +00:00
rc.sendmail pkgbase: Really move rc.sendmail 2019-05-22 07:40:39 +00:00
rc.shutdown rc.shutdown: kill shutdown process after logging message 2019-12-07 00:33:08 +00:00
rc.subr rc.subr: Make sure oomprotect protects existing children 2022-07-22 02:09:10 +02:00
rc.suspend