Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am following these instructions to install OpenLDAP on Debian 6.0.

The instructions tell me to run slapindex as root, but it sounds like Debian does not like the idea:

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

Google leads me to a discussion that suggests running slapindex as openldap. I find it strange as slapindex is not in the $PATH of openldap.

Which user should I run slapindex as?
If not root, why is slapindex in /usr/sbin?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You sure can use both root and openldap as user running slapindex, but if you do it as root, please don't forget to change the OpenLDAP data directory permissions back to openldap:openldap if you do so. For example,

chown -R openldap:openldap /var/lib/ldap/

Why slapindex is under /usr/sbin, I don't know. Perhaps because it is a very powerful and potentially dangerous tool which should be used those capable of being root, anyway.

share|improve this answer
    
It's probably in /usr/sbin because it is an administrative tool that requires specific permissions (though not necessarily root, obviously) to run. Displaying it in the hypothetical list of "user" commands, such as with tab completion in bash, would be silly. –  Falcon Momot Aug 14 '13 at 7:40

If not root, why is slapindex in /usr/sbin?

According to the FHS (Filesystem Hierarchy Standard) /usr/sbin are used for Non-essential system binaries, e.g., daemons for various network-services.

On CentOS, after executing slapindex as root you should change owner of the index in /var/lib/ldap to the ldap user, which is by default ldap. You could try to use su instead

# su - <ldap_user> -s /bin/bash /usr/sbin/slapindex
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.