AnswerBun.com

Job for slapd.service failed because the control process exited with error code?

Server Fault Asked by Subodh Joshi on January 5, 2022

I have setup OpenLdap its starting properly after that due to some issue i kill the process.Now when ever i am trying systemctl start slapd.service i am getting

Job for slapd.service failed because the control process exited with
error code. See “systemctl status slapd.service” and “journalctl -xe”
for details.

this command journalctl -xe giving below information

Nov 28 21:54:36 suredevbana3 systemd[1]: Starting OpenLDAP Server Daemon...
-- Subject: Unit slapd.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit slapd.service has begun starting up.
Nov 28 21:54:36 suredevbana3 runuser[2898]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Nov 28 21:54:36 suredevbana3 runuser[2898]: pam_unix(runuser:session): session closed for user ldap
Nov 28 21:54:36 suredevbana3 slapcat[2902]: DIGEST-MD5 common mech free
Nov 28 21:54:36 suredevbana3 runuser[2909]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Nov 28 21:54:36 suredevbana3 runuser[2909]: pam_unix(runuser:session): session closed for user ldap
Nov 28 21:54:36 suredevbana3 runuser[2911]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Nov 28 21:54:36 suredevbana3 runuser[2911]: pam_unix(runuser:session): session closed for user ldap
Nov 28 21:54:36 suredevbana3 runuser[2913]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Nov 28 21:54:36 suredevbana3 runuser[2913]: pam_unix(runuser:session): session closed for user ldap
Nov 28 21:54:36 suredevbana3 runuser[2915]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Nov 28 21:54:36 suredevbana3 runuser[2915]: pam_unix(runuser:session): session closed for user ldap
Nov 28 21:54:36 suredevbana3 runuser[2917]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Nov 28 21:54:36 suredevbana3 runuser[2917]: pam_unix(runuser:session): session closed for user ldap
Nov 28 21:54:36 suredevbana3 check-config.sh[2894]: Read/write permissions for DB file '/var/lib/ldap/__db.001' are required.
Nov 28 21:54:36 suredevbana3 runuser[2919]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Nov 28 21:54:36 suredevbana3 runuser[2919]: pam_unix(runuser:session): session closed for user ldap
Nov 28 21:54:36 suredevbana3 check-config.sh[2894]: Read/write permissions for DB file '/var/lib/ldap/__db.002' are required.
Nov 28 21:54:36 suredevbana3 runuser[2921]: pam_unix(runuser:session): session opened for user ldap by (uid=0)
Nov 28 21:54:36 suredevbana3 runuser[2921]: pam_unix(runuser:session): session closed for user ldap
Nov 28 21:54:36 suredevbana3 check-config.sh[2894]: Read/write permissions for DB file '/var/lib/ldap/__db.003' are required.
Nov 28 21:54:36 suredevbana3 systemd[1]: slapd.service: control process exited, code=exited status=1
Nov 28 21:54:36 suredevbana3 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. Nov 28 21:54:36 suredevbana3 systemd[1]: Unit slapd.service entered failed state. Nov 28 21:54:36 suredevbana3 systemd[1]: slapd.service failed. Nov 28 21:54:36 suredevbana3 polkitd[717]: Unregistered Authentication Agent for unix-process:2887:70553439 (system bus name :1.2956, object path /org/freedesktop/PolicyKit1lines 2393-2430/2430 (END)

After this i check this slapd -d 1 which gave me following information
l

dap_url_parse_ext(ldap://localhost/)
ldap_init: trying /etc/openldap/ldap.conf
ldap_init: using /etc/openldap/ldap.conf
ldap_init: HOME env is /root
ldap_init: trying /root/ldaprc
ldap_init: trying /root/.ldaprc
ldap_init: LDAPCONF env is NULL
ldap_init: LDAPRC env is NULL
5a1d9112 @(#) $OpenLDAP: slapd 2.4.44 (Jun  6 2017 18:04:02) $
        [email protected]:/builddir/build/BUILD/openldap-2.4.44/openldap-2.4.44/servers/slapd
ldap_pvt_gethostbyname_a: host=suredevbana3, r=0
5a1d9112 daemon_init: listen on ldap:///
5a1d9112 daemon_init: 1 listeners to open...
ldap_url_parse_ext(ldap:///)
5a1d9112 daemon: bind(7) failed errno=98 (Address already in use)
5a1d9112 daemon: bind(7) failed errno=98 (Address already in use)
5a1d9112 slap_open_listener: failed on ldap:///
5a1d9112 slapd stopped.
5a1d9112 connections_destroy: nothing to destroy.

Please find below

" ============================================================================
" Netrw Directory Listing                                        (netrw v149)
"   /etc/openldap/slapd.d/cn=config
"   Sorted by      name
"   Sort sequence: [/]$,<core%(.d+)=>,.h$,.c$,.cpp$,~=*$,*,.o$,.obj$,.info$,.swp$,.bak$,~$
"   Quick Help: <F1>:help  -:go up dir  D:delete  R:rename  s:sort-by  x:exec
" ============================================================================
../
./
cn=schema/
cn=schema.ldif
olcDatabase={-1}frontend.ldif
olcDatabase={0}config.ldif
olcDatabase={1}monitor.ldif
olcDatabase={2}hdb.ldif
.swp

One more information its started with this command

slapd -d -1 -F /etc/openldap/slapd.d

3 Answers

  1. Disable your SELINUX.

  2. Install the required certificates specified in the file:

    olcDatabase={2}hdb.ldif
    

Answered by kinnreaveena D on January 5, 2022

I also facing the same problem but I have resolved with below command:

setenforce 0
getenforce

If you want to persist it:

vi /etc/selinux/config

Change this parameter SELINUX=enforcing to SELINUX=permissive

Answered by user584456 on January 5, 2022

check-config.sh[2894]: Read/write permissions for DB file '/var/lib/ldap/__db.003' are required.

slapd runs as ldap user by default, if you attempted to start it (or loaded ldif etc..) as root user, it'd create files with incorrect permission. Try chown -R ldap.ldap /var/lib/ldap to fix the permissions and start the service.

Answered by Najmuddin on January 5, 2022

Add your own answers!

Related Questions

How to choose best EC2 instance for the system

3  Asked on January 1, 2021 by user14108508

   

Equivalent of Firebase with PostGreSQL?

0  Asked on December 31, 2020 by dimitri-l

   

Sticky TCP sessions with IOT sensors

0  Asked on December 31, 2020 by quade

   

Failed to using powershell to get cookies

1  Asked on December 30, 2020 by pansal

     

Heroku.yml is not getting bash script

0  Asked on December 29, 2020 by shahrear-bin-amin

   

D-Link DGS-1210-28 factory reset

0  Asked on December 27, 2020 by andrey-salnikov

       

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir