Author Topic: slapd[4551]: warning: cannot open /etc/hosts.allow: Too many open files  (Read 8360 times)

sheck

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Dear all,

our ldap (slave, zentyal 2.2) stops working because of

Code: [Select]
slapd[4551]: warning: cannot open /etc/hosts.allow: Too many open files

I increased limits:

Code: [Select]
less /etc/security/limits.conf
...
root             soft    nofile          65536
root             hard    nofile          65536
openldap         soft    nofile          65536
openldap         hard    nofile          65536
*                soft    nofile          65536
*                hard    nofile          65536

and

Code: [Select]
less /etc/sysctl.conf
...
fs.file-max = 120000

which looks quite ok:
Code: [Select]
ulimit -a
...
open files (-n) 65536

BUT slapd still only uses 1024...

Code: [Select]
cat /proc/"slapdID"/limits
...
Max open files            1024                 1024                 files   

Any ideas?

Thanks!
Steve

gzen

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +2/-0
    • View Profile
Re: slapd[4551]: warning: cannot open /etc/hosts.allow: Too many open files
« Reply #1 on: February 13, 2014, 12:29:15 am »
try adding this line to /etc/pam.d/common-session and reboot.

session required pam_limits.so

sheck

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: slapd[4551]: warning: cannot open /etc/hosts.allow: Too many open files
« Reply #2 on: February 13, 2014, 09:43:55 am »
Thanks for your reply!

I already have session required pam_limits.so in /etc/pam.d/common-session, sorry I forgot to mention that...

Any other ideas?

gzen

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +2/-0
    • View Profile
Re: slapd[4551]: warning: cannot open /etc/hosts.allow: Too many open files
« Reply #3 on: February 13, 2014, 08:37:23 pm »

Try uncomment this line in /etc/pam.d/su and reboot.

session    required   pam_limits.so

sheck

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: slapd[4551]: warning: cannot open /etc/hosts.allow: Too many open files
« Reply #4 on: February 13, 2014, 09:39:45 pm »
Still no success...

Code: [Select]
cat /proc/"slapdID"/limits
...
Max open files            1024                 1024                 files   

really strange :(

But nevertheless thanks for your reply!

gzen

  • Zen Apprentice
  • *
  • Posts: 14
  • Karma: +2/-0
    • View Profile
Re: slapd[4551]: warning: cannot open /etc/hosts.allow: Too many open files
« Reply #5 on: February 13, 2014, 11:43:39 pm »
give it last try, i'm running out of idea.

set your ulimit in this file, i'm from solaris/rhel, ubuntu doesn't follow the linux standards, drives me nuts too.
/etc/default/slapd

ulimit -n 65536  or maybe ULIMIT="-n 65536"

haven't tested.

btw, are you on 32bit?
« Last Edit: February 14, 2014, 01:44:33 am by gzen »

sheck

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: slapd[4551]: warning: cannot open /etc/hosts.allow: Too many open files
« Reply #6 on: February 14, 2014, 09:57:35 am »
i am on 64bit (ubuntu 10.4 LTS with zentyal 2.2). all other processes (e.g tomcat) also taking the ulimit of 65526 without problems. slapd or the zentyal launcher are a bit strange it seems...

i try modifying /etc/default/slapd and report back.

thanks again!

sheck

  • Zen Monk
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: slapd[4551]: warning: cannot open /etc/hosts.allow: Too many open files
« Reply #7 on: February 14, 2014, 01:44:22 pm »
Code: [Select]
cat /proc/"slapdID"/limits
...
Max open files            1024                 1024                 files   

still the same... getting crazy here... :(

found this: https://bugs.launchpad.net/ubuntu/+source/openldap/+bug/632314 but the solution is the same as you suggested.

I think I write a cron-job which restarts slapd when connection-limit is hit... and maybe a zentyal / ubuntu update in the future...