slapd fails to start on boot due to /var/run/openldap/ missing

Solution Verified - Updated -

Issue

  • slapd appears to fail to start every boot.
<root@localhost:~># systemctl status slapd -l
● slapd.service - OpenLDAP Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/slapd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2018-06-11 11:43:48 EDT; 41min ago
     Docs: man:slapd
           man:slapd-config
           man:slapd-hdb
           man:slapd-mdb
           file:///usr/share/doc/openldap-servers/guide.html
  Process: 1270 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE)
  Process: 1195 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)

Jun 11 11:43:48 localhost runuser[1261]: pam_unix(runuser:session): session closed for user ldap
Jun 11 11:43:48 localhost runuser[1267]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Jun 11 11:43:48 localhost slapd[1270]: @(#) $OpenLDAP: slapd 2.4.44 (Apr  3 2018 08:03:36) $
                                                  mockbuild@x86-034.build.eng.bos.redhat.com:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/servers/slapd
Jun 11 11:43:48 localhost slapd[1308]: unable to open pid file "/var/run/openldap/slapd.pid": 2 (No such file or directory)
Jun 11 11:43:48 localhost slapd[1308]: slapd stopped.
Jun 11 11:43:48 localhost slapd[1308]: connections_destroy: nothing to destroy.
Jun 11 11:43:48 localhost systemd[1]: slapd.service: control process exited, code=exited status=1
Jun 11 11:43:48 localhost systemd[1]: Failed to start OpenLDAP Server Daemon.
Jun 11 11:43:48 localhost systemd[1]: Unit slapd.service entered failed state.
Jun 11 11:43:48 localhost systemd[1]: slapd.service failed.
<root@localhost:~>#

Environment

  • RHEL
  • Openldap

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content