Problem: Ldapserver does not start anymore

Problem:

Ldapserver does not start anymore:
root@ucs:~# service slapd start

[…] Check database: …[info] Could not determine BDB version of /var/lib/univention-ldap/ldap.
[info] Skipping /usr/bin/db5.1_recover to avoid damage.
[FAIL] Starting ldap server(s): slapd …failed.
[info] 60476bbd OVER: Loading Translog Overlay 60476bbd OVER: db_init 60476bbd OVER: Configuring Translog Overlay 60476bbd OVER: Configured Translog Overlay to use file
“/var/lib/univention-ldap/listener/listener” 60476bcf bdb(dc=schein,dc=lokal): unable to join the environment 60476bcf bdb_db_open: database “dc=schein,dc=lokal” cannot
be opened, err 11. Restore from backup! 60476bcf backend_startup_one (type=bdb, suffix=“dc=schein,dc=lokal”): bi_db_open failed! (11) slap_startup failed.

Solution:

Stop running and relevant services:

root@ucs:~#systemctl stop univention-directory-listener.service
root@ucs:~#systemctl stop univention-s4-connector.service
root@ucs:~#/etc/init.d/slapd stop
root@ucs:~#slapcat -l slapd-export.ldif -f /etc/ldap/slapd.conf -b "$(ucr get ldap/base)"
root@ucs:~#mv /var/lib/univention-ldap/ldap /var/lib/univention-ldap/ldap-2021-03-09
root@ucs:~#mkdir /var/lib/univention-ldap/ldap/
root@ucs:~#cp /var/lib/univention-ldap/ldap-2021-03-09/DB_CONFIG /var/lib/univention-ldap/ldap/
root@ucs:~#chown -R openldap.openldap /var/lib/univention-ldap/ldap
root@ucs:~#chmod +x /var/lib/univention-ldap/ldap
root@ucs:~#/etc/init.d/slapd start # creates an empty db
root@ucs:~#/etc/init.d/slapd stop
root@ucs:~#slapadd -l slapd-export.ldif -f /etc/ldap/slapd.conf -b "$(ucr get ldap/base)"
root@ucs:~#chown -R openldap.openldap /var/lib/univention-ldap/ldap
root@ucs:~#/etc/init.d/slapd start
root@ucs:~#systemctl start univention-directory-listener.service
root@ucs:~#systemctl start univention-s4-connector.service

This may be also applicable to ldap with mdb!

See also:

This topic was automatically closed after 24 hours. New replies are no longer allowed.