Date: Thu, 28 Jan 2016 21:49:17 +0800 From: Marcelo Araujo <araujobsdport@gmail.com> To: Eugene Grosbein <eugen@grosbein.net> Cc: Marcelo Araujo <araujo@freebsd.org>, Adrian Chadd <adrian.chadd@gmail.com>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: syslogd(8) with OOM Killer protection Message-ID: <CAOfEmZioxz2nCjbK0L7QW-EXYs1Pgoyaf7BxZgtkdLhhpVq4=g@mail.gmail.com> In-Reply-To: <56AA11EA.1060903@grosbein.net> References: <CAOfEmZgzL2Ldu53CeSsKcUe00H1VAukhEopSUmpUK0=XAhsD1A@mail.gmail.com> <CAJ-Vmomhzg5CCNdTVhecC8n3xMsvHODfG_k35mi6n0ftmikPOw@mail.gmail.com> <56AA11EA.1060903@grosbein.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In my research, I might be wrong, there is no clean way to make such protection without intrusive code in every each deamon. I'm still checking!! On Jan 28, 2016 9:05 PM, "Eugene Grosbein" <eugen@grosbein.net> wrote: > On 27.01.2016 13:32, Adrian Chadd wrote: > > I like it,how's it not done via some command line tool that we can run > > any tool with? > > I've already responded to such idea in a comment to my original PR > and like to repeat it here. IMHO, it is nearly impossible to correctly > implement > such protection for arbitrary daemonizing service by means of rc.subr, > without modifications of service source code. Currently. > > We do have protect(1) utility but it only can protect single process it > starts or > all current/future children of started process and for daemons both cases > are wrong: > > - protection of single process is meaningless because it forks to become > daemon and that ceases protection; > - protection of all future children is dangerous for daemons capable of > running arbitrary subprocesses like syslogd can with "vertical bar" syntax > of syslog.conf(5) as those future children may be "runaway" memory hogs. > > Perhaps, we could have kernel facility that keeps decreasing counter of > forks > and ceases protection of children when counter reaches zero level. > Then teach protect(1) to (re-)set counter value and make rc.subr use it. > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfEmZioxz2nCjbK0L7QW-EXYs1Pgoyaf7BxZgtkdLhhpVq4=g>