Score:0

How to create accesslog in OpenLDAP with name "{2}accesslog"

bw flag

I'm trying to setup OpenLdap on ubuntu.

The following command is trying to add the accesslog database:

ldapmodify -Y EXTERNAL -H ldapi:/// -f test.ldif

When the name is "{2}mdb", the result is success:

dn: olcDatabase={2}mdb,cn=config
changetype: add
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {2}mdb
olcDbDirectory: /var/lib/ldap/accesslog
olcSuffix: cn=accesslog
olcRootDN: cn=test,dc=example,dc=com
olcDbIndex: default eq
olcDbIndex: entryCSN,objectClass,reqEnd,reqResult,reqStart

Here is the result:

olcDatabase: {-1}frontend
olcDatabase: {0}config
olcDatabase: {1}mdb
olcDatabase: {2}mdb

But when the name is "{2}accesslog", the result is failed:

dn: olcDatabase={2}accesslog,cn=config
changetype: add
objectClass: olcDatabaseConfig
objectClass: olcMdbConfig
olcDatabase: {2}accesslog
olcDbDirectory: /var/lib/ldap/accesslog
olcSuffix: cn=accesslog
olcRootDN: cn=test,dc=example,dc=com
olcDbIndex: default eq
olcDbIndex: entryCSN,objectClass,reqEnd,reqResult,reqStart

adding new entry "olcDatabase={2}accesslog,cn=config"
ldap_add: Other (e.g., implementation specific) error (80)
    additional info: <olcDatabase> failed init

Here is the result:

olcDatabase: {-1}frontend
olcDatabase: {0}config
olcDatabase: {1}mdb

There is already a database called "{1}mdb". Is it possible for changing the accesslog database name to "{2}accesslog"?

Score:0
in flag

I have a feeling that you are trying to use LDAP for something it is not intended to. Creating a new database is needed only if you want to create separate DITs, i.e. separate trees with distinct roots.

The "mdb" part in {1}mdb is not the name of the database, but its type. Therefore, it is not a free-form entry, as you need to specify a type of the database the server supports ("mdb" is a safe bet here).

I sit in a Tesla and translated this thread with Ai:

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.