lists.arthurdejong.org
RSS feed

Re: nslcd and Linux OOM killer

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: nslcd and Linux OOM killer



On Tue, Mar 10, 2015 at 13:22:56 +1100, Trent W. Buck wrote:
> Iain Morgan wrote:
> > I'm a little surprised that this hasn't come up on this list previously,
> > but I recently encountered a situation where the Linux OOM killer shot
> > nslcd. A quick grep through the current source code shows no reference
> > to oom_score_adj or oom_adj, so it doesn't look like there are any
> > safeguards against this.
> >
> > Given that killing off nslcd can lead to having a bad day, I'd like to
> > suggest that code be added to make nslcd unkillable by the OOM killer.
> >
> > As background, this happened on a Centos 6 system running a 0.8.x
> > version of nss-pam-ldapd.
> 
> I assume you're proposing changing nslcd's C source.
> Ubuntu does this for sshd, in the init job.
> Is that more reasonable?  (I'm ambivalent.)
> 

Yes, I was suggesting doing it in the source code. However, I can see
the argument for doing it in the init job. The source code approach has
the advantage of being a single change that is independent of the init
mechanism, while the init approach is arguably simpler.

I guess I still lean towards the source code fix, but i admit that I
don't have a strong argument either way.

> I'm basically imagining a README or example init job that suggests
> distros disable OOM, rather than simply doing so.
> 
> For upstart (init(5)):
> 
>        oom ADJUSTMENT|never
>               Normally  the  OOM  killer  regards   all   processes
>               equally, this stanza advises the kernel to treat this
>               job differently.
> 
>               ADJUSTMENT may be an integer  value  from  -16  (very
>               unlikely  to  be  killed  by the OOM killer) up to 14
>               (very likely to be killed by the OOM killer).  It may
>               also  be  the  special  value  never  to have the job
>               ignored by the OOM killer entirely.
> 
> For systemd (systemd.exec(5)):
> 
>        OOMScoreAdjust=
>            Sets the adjustment level for the Out-Of-Memory killer
>            for executed processes. Takes an integer between -1000
>            (to disable OOM killing for this process) and 1000 (to
>            make killing of this process under memory pressure very
>            likely). See proc.txt[1] for details.

-- 
Iain Morgan
-- 
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users/