1

I set up two hosts with OpenLDAP in N-way multi master replication by following this website. One of the installations is a Debian 9.2, the other one is Ubuntu 16.04. The troubled Ubuntu host runs the OpenLDAP server without problems since a couple of weeks. However, after I added the replication, it refused to start again.

Regular start fails

On the fresh Debian host, the server starts fine - only replication is set up. On the Ubuntu host, OpenLDAP refuses to start. When trying to started with

$ service slapd start

the syslog says

read_config: no serverID / URL match found. Check slapd -h arguments.  

Foreground start fails

The same when run in foreground mode,

$ slapd -d -1

Foreground start with -h works

Surprisingly, it works when appending the -h option

$ slapd -d -1 -h ldap2.myhost.loc

Config ignored?

The setting in the configuration seems to be ignored completely:

$ grep -v '^$' /etc/ldap/ldap.conf | grep -v '^#'
BASE    dc=myldapdomain,dc=loc
URI ldap://ldap2.myhost.loc
TLS_CACERT  /etc/ssl/certs/ca-certificates.crt

although it is loaded:

$ slapd -d -1
ldap_url_parse_ext(ldap://localhost/)
ldap_init: trying /etc/ldap/ldap.conf
ldap_init: using /etc/ldap/ldap.conf

What am I missing on the OpenLDAP installation on the Ubuntu host in order to start the server successfully?

1 Answer 1

-1

Your -h argument to slapd should contain an LDAP URI that matches one of the values listed for the olcServerID attribute. So following the documentation you linked to you would use -h "ldapi:// ldap://ldap1.gremaud.local" (note the -h value should be quoted to list multiple whitespace-separated URI's as one value). Without that, my understanding is the server can't work out which server ID is itself from the values of the olcServerID attribute, hence the error.

I don't think /etc/ldap/ldap.conf has anything to do with this, it's a client configuration file.

7
  • I also thought that this was the client config, but as you can see, it is loaded by slapd. I said in my original post that it works with the -h option, but I want it to start properly without this option, so it must be set in a config file. Oct 31, 2017 at 18:02
  • So set it. You claim to have followed the documentation you linked to except you've clearly missed step 3; which tells you to edit /etc/default/slapd which will result in setting the -h option, it even states the error you'll get if you don't do this, matching what you saw in syslog.
    – bodgit
    Nov 1, 2017 at 9:24
  • The setting in the /etc/default/slapd is relevant on my Debian host but it is completely ignored in Ubuntu. Nov 1, 2017 at 11:00
  • I've looked at the Ubuntu 16.04 slapd package and it still has an /etc/default/slapd file with a SLAPD_SERVICES variable which is referenced in /etc/init.d/slapd so it looks like it would work to me. Does 16.04 also support systemd? I can't find the unit file for slapd but it should have something like EnvironmentFile=/etc/default/slapd in it somewhere to achieve the same goal.
    – bodgit
    Nov 1, 2017 at 12:05
  • 1
    Ok, sorry, forget about this question. I inserted a debug log in the init script and found a typo in the /etc/default/slapd file. bump. Sorry for that, which took me some hours. Nov 2, 2017 at 10:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .