Use MDB backend in Ubuntu

The MDB backend is the default in Ubuntu and specifying
HDB in debconf doesn't change it to HDB.

Closes-Bug: #1939700
Change-Id: If98f7fc8395678365fb73f0c5cd926cef083e470
This commit is contained in:
Grzegorz Grasza 2021-08-16 10:36:03 +02:00
parent 0d5ba5b250
commit 26f8149218
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
dn: olcDatabase={${LDAP_OLCDB_NUMBER}}hdb,cn=config dn: olcDatabase={${LDAP_OLCDB_NUMBER}}${LDAP_OLCDB_TYPE},cn=config
changetype: modify changetype: modify
replace: olcSuffix replace: olcSuffix
olcSuffix: ${BASE_DN} olcSuffix: ${BASE_DN}

View File

@ -33,14 +33,17 @@ LDAP_SERVICE_NAME=slapd
if is_ubuntu; then if is_ubuntu; then
LDAP_OLCDB_NUMBER=1 LDAP_OLCDB_NUMBER=1
LDAP_OLCDB_TYPE=mdb
LDAP_ROOTPW_COMMAND=replace LDAP_ROOTPW_COMMAND=replace
elif is_fedora; then elif is_fedora; then
LDAP_OLCDB_NUMBER=2 LDAP_OLCDB_NUMBER=2
LDAP_OLCDB_TYPE=hdb
LDAP_ROOTPW_COMMAND=add LDAP_ROOTPW_COMMAND=add
elif is_suse; then elif is_suse; then
# SUSE has slappasswd in /usr/sbin/ # SUSE has slappasswd in /usr/sbin/
PATH=$PATH:/usr/sbin/ PATH=$PATH:/usr/sbin/
LDAP_OLCDB_NUMBER=1 LDAP_OLCDB_NUMBER=1
LDAP_OLCDB_TYPE=hdb
LDAP_ROOTPW_COMMAND=add LDAP_ROOTPW_COMMAND=add
LDAP_SERVICE_NAME=ldap LDAP_SERVICE_NAME=ldap
fi fi
@ -56,6 +59,7 @@ function _ldap_varsubst {
local slappass=$2 local slappass=$2
sed -e " sed -e "
s|\${LDAP_OLCDB_NUMBER}|$LDAP_OLCDB_NUMBER| s|\${LDAP_OLCDB_NUMBER}|$LDAP_OLCDB_NUMBER|
s|\${LDAP_OLCDB_TYPE}|$LDAP_OLCDB_TYPE|
s|\${SLAPPASS}|$slappass| s|\${SLAPPASS}|$slappass|
s|\${LDAP_ROOTPW_COMMAND}|$LDAP_ROOTPW_COMMAND| s|\${LDAP_ROOTPW_COMMAND}|$LDAP_ROOTPW_COMMAND|
s|\${BASE_DC}|$LDAP_BASE_DC| s|\${BASE_DC}|$LDAP_BASE_DC|
@ -157,7 +161,7 @@ function configure_ldap {
slapd slapd/dump_database_destdir string /var/backups/slapd-VERSION slapd slapd/dump_database_destdir string /var/backups/slapd-VERSION
slapd slapd/domain string Users slapd slapd/domain string Users
slapd shared/organization string $LDAP_DOMAIN slapd shared/organization string $LDAP_DOMAIN
slapd slapd/backend string HDB slapd slapd/backend string ${LDAP_OLCDB_TYPE^^}
slapd slapd/purge_database boolean true slapd slapd/purge_database boolean true
slapd slapd/move_old_database boolean true slapd slapd/move_old_database boolean true
slapd slapd/allow_ldap_v2 boolean false slapd slapd/allow_ldap_v2 boolean false