我正在尝试在 linux 系统上使用 lmdb 后端配置 openldap-2.4.43。到目前为止没有成功。
slapd.conf:
include /opt/openldap/etc/schema/core.schema
include /opt/openldap/etc/schema/cosine.schema
include /opt/openldap/etc/schema/inetorgperson.schema
allow bind_v2
pidfile /var/run/slapd.pid
argsfile /var/run/slapd.args
database config
rootdn "cn=Manager,cn=config"
rootpw {SSHA}sMXtPWSAL9yEgDslsXMZiM+qgLJZW9VO
database mdb
suffix "dc=mydomain,dc=com"
rootdn "cn=Manager,dc=mydomain,dc=com"
rootpw {SSHA}sMXtPWSAL9yEgDslsXMZiM+qgLJZW9VO
directory /var/openldap/data/main/
maxsize 10485760
index objectClass eq,pres
index ou,cn,mail,surname,givenname eq,pres,sub
slaptest (/opt/openldap/sbin/slaptest -f slapd.conf -F ./slapd.d/) 结果(最后一部分):
stat("/var/openldap/data/main/", {st_mode=S_IFDIR|0700, st_size=40, ...}) = 0
getpid() = 2440
brk(0x828a000) = 0x828a000
open("/var/openldap/data/main//data.mdb", O_RDONLY) = -1 ENOENT (No such file or directory)
time(NULL) = 1453993047
write(2, "56aa2c57 mdb_db_open: database \""..., 12256aa2c57 mdb_db_open: database "dc=mydomain,dc=com" cannot be opened: No such file or directory (2). Restore from backup!) = 122
time(NULL) = 1453993047
write(2, "56aa2c57 backend_startup_one (ty"..., 9356aa2c57backend_startup_one (type=mdb, suffix="dc=mydomain,dc=com"): bi_db_open failed! (2)) = 93
write(2, "slap_startup failed (test would "..., 61slap_startup failed (test would succeed using the -u switch)) = 61
_exit(1) = ?
+++ exited with 1 +++
/var/openldap/data/main 是可写的。系统只有一个 root 用户。
我尝试更改目标文件夹,设置 ulimit -c 无限制,更改 maxsize 的值。都没有任何明显的结果。
我错过了什么?为什么 openldap 假设 /var/openldap/data/main//data.mdb 应该已经存在并且不会自行创建?