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



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.)

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.
-- 
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users/