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.

If I just run slapd with no arguments (as root) it starts and works fine. When I try to start it using /etc/init.d/slapd start however, it dies immediately.

I see from looking at the init script that there's a configuration file at /etc/sysconfig/ldap, but I haven't been able to find a working combination of settings. Does anybody know what I need to do?


I went back to the default init script and tried running with debugging, but I didn't see anything helpful. Main details were:

daemon --pidfile=/var/run/slapd.pid --check=slapd /usr/sbin/slapd -h '" ldap:///"' -u ldap
/bin/bash -c 'ulimit -S -c 0 >/dev/null 2>&1 ; /usr/sbin/slapd -h " ldap:///" -u ldap'`.
share|improve this question
    
Any log file entries that would help? –  Sven Jul 3 '13 at 21:12
    
@SvW Unfortunately no. All I know is that it creates the .pid file before it exits –  Brad Mace Jul 3 '13 at 21:21
    
I tried removing and hardcoding things in the init script until the start() function was just running slapd like I had done manually, and even then it doesn't work. Not sure what's going on. –  Brad Mace Jul 3 '13 at 21:41
    
which version of centos do you use? –  ALex_hha Jul 4 '13 at 17:23
    
you could try to run with some debug sh -x /etc/init.d/slapd start –  ALex_hha Jul 4 '13 at 17:31

1 Answer 1

up vote 0 down vote accepted

After trying to start manually using /usr/sbin/slapd -u ldap and discovering it didn't work, I eventually thought to try turning off selinux (setenforce 0; I have another question about making it work with selinux enabled) which allowed it to run as the ldap user (and therefore allowed the standard init script to work).

The man page says that the default URL when -h is not given is ldap:/// (TCP on all interfaces on default port). So to get the equivalent behavior to running slapd with no arguments you need to set

SLAPD_LDAP=yes
SLAPD_LDAPI=no
SLAPD_LDAPS=no

in /etc/sysconfig/ldap.

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.