Score:0

slapd service is not starting on centos 7

cn flag

Hi while I was trying to install open-ldap in my centos 7 server, I think I runned yum remove ldap command(I am not sure exactly) and now slap service is not working at all

[root@kwephispra28828 etc]# systemctl start slapd
Job for slapd.service failed because the control process exited with error code. See "systemctl status slapd.service" and "journalctl -xe" for details.


[root@kwephispra28828 etc]# journalctl -xe
Dec 09 16:36:04 kwephispra28828 runuser[53027]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Dec 09 16:36:04 kwephispra28828 runuser[53027]: pam_unix(runuser:session): session closed for user ldap
Dec 09 16:36:04 kwephispra28828 slapcat[53031]: DIGEST-MD5 common mech free
Dec 09 16:36:04 kwephispra28828 slapd[53039]: @(#) $OpenLDAP: slapd 2.4.44 (Aug 31 2021 14:48:49) $
                                                      [email protected]:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/servers/slapd
Dec 09 16:36:05 kwephispra28828 slapd[53039]: main: TLS init def ctx failed: -1
Dec 09 16:36:05 kwephispra28828 slapd[53039]: DIGEST-MD5 common mech free
Dec 09 16:36:05 kwephispra28828 slapd[53039]: slapd stopped.
Dec 09 16:36:05 kwephispra28828 slapd[53039]: connections_destroy: nothing to destroy.
Dec 09 16:36:05 kwephispra28828 systemd[1]: slapd.service: control process exited, code=exited status=1
Dec 09 16:36:05 kwephispra28828 systemd[1]: Failed to start OpenLDAP Server Daemon.
-- Subject: Unit slapd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit slapd.service has failed.
--
-- The result is failed.
Dec 09 16:36:05 kwephispra28828 systemd[1]: Unit slapd.service entered failed state.
Dec 09 16:36:05 kwephispra28828 systemd[1]: slapd.service failed.
Dec 09 16:36:05 kwephispra28828 polkitd[6312]: Unregistered Authentication Agent for unix-process:53016:5514800560 (system bus name :1.1155728, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconn
lines 2509-2566/2566 

and this is the systemctl status

[root@kwephispra28828 etc]# systemctl status slapd
● slapd.service - OpenLDAP Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/slapd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2021-12-09 16:36:05 +03; 2min 19s ago
     Docs: man:slapd
           man:slapd-config
           man:slapd-hdb
           man:slapd-mdb
           file:///usr/share/doc/openldap-servers/guide.html
  Process: 53039 ExecStart=/usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS (code=exited, status=1/FAILURE)
  Process: 53022 ExecStartPre=/usr/libexec/openldap/check-config.sh (code=exited, status=0/SUCCESS)

Dec 09 16:36:04 kwephispra28828 slapcat[53031]: DIGEST-MD5 common mech free
Dec 09 16:36:04 kwephispra28828 slapd[53039]: @(#) $OpenLDAP: slapd 2.4.44 (Aug 31 2021 14:48:49) $
                                                      [email protected]:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/servers/slapd
Dec 09 16:36:05 kwephispra28828 slapd[53039]: main: TLS init def ctx failed: -1
Dec 09 16:36:05 kwephispra28828 slapd[53039]: DIGEST-MD5 common mech free
Dec 09 16:36:05 kwephispra28828 slapd[53039]: slapd stopped.
Dec 09 16:36:05 kwephispra28828 slapd[53039]: connections_destroy: nothing to destroy.
Dec 09 16:36:05 kwephispra28828 systemd[1]: slapd.service: control process exited, code=exited status=1
Dec 09 16:36:05 kwephispra28828 systemd[1]: Failed to start OpenLDAP Server Daemon.
Dec 09 16:36:05 kwephispra28828 systemd[1]: Unit slapd.service entered failed state.
Dec 09 16:36:05 kwephispra28828 systemd[1]: slapd.service failed.

Any idea how to fix this ?

cn flag
Could you source the environment file on a terminal: source /etc/sysconfig/slapd, and then run the command that is displayed in ExecStart: /usr/sbin/slapd -u ldap -h ${SLAPD_URLS} $SLAPD_OPTIONS, and post the results you get on the terminal? The error should appear in there.
cn flag
It shows nothing. I checked s/etc/sysconfig/slapd file there is onyl SLAPD_URLS fields is not commented, rest of the file is commented out.
cn flag
add -d? and choose one of the options to get extra debugging info
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.