Debian – Problem with LDAP: ldapindex

debianldapopenldap

I'm installing ldap server on debian machine. Here is the link to the guide I am following:

http://www.debian-administration.org/article/OpenLDAP_installation_on_Debian

I installed all the needed packages and edited all the neccessary config files.

sudo invoke-rc.d slapd stop
sudo slapindex
sudo chown openldap:openldap /var/lib/ldap/*
sudo invoke-rc.d slapd start

But when I try to restart server with newly added options I got this warning:

WARNING!
Runnig as root!
There's a fair chance slapd will fail to start.
Check file permissions!

I searched for it and found a bug report here: bugs.debian.org/cgi-bin/bugreport.cgi?bug=432662

So I tried to run the command to execute ldapindex as openldap user and it seemed to work nicely, but ldap did not saved my new configs.

Any suggestions?

Best Answer

As far as I remember from our LDAP install (long time ago), you should edit the /etc/default/slapd and add the following:

SLAPD_USER="openldap"
SLAPD_GROUP="openldap"

and then restart your server.

Hope it helps!