Redhat – slapd dead but pid file exists openldap

openldapredhat

I am facing issue with our new LDAP servers as they go down one by one alternatively. When checked for the services it says:

"slapd dead but pid file exists openldap"

but show no service running ps -ea | grep slapd. When the service is restarted, LDAP starts with message

"bdb_db_open: database "dc=root": unclean shutdown detected; attempting recovery.slapd starting" a

nd works perfectly until the issue comes again.

There is nothing in the ldap logs much to investigate as each time it overwrites the logs but i got below error once it had stopped.

slapd[30190]: daemon: bind(7) failed errno=13 (Permission denied)
slapd[30190]: slapd stopped.

I checked the access to ldap user on certificates folder and it has read\write access on it.
Unlike others, my LDAP starts with service slapd start on RHEL.
Please help,

Best Answer

The service was stopped and does not delete the file pid.
Check the file slapd.conf and look for the pidfile variable:

pidfile /var/run/slapd/slapd.pid

Delete it.

rm -f /var/run/slapd/slapd.pid