[Pkg-openldap-devel] pre-bug discussion: "Backup path (...) unknown (...). Giving up..."

pedeb pedeb at cas.cat
Mon Dec 31 20:34:16 GMT 2018


Hi,

Sorry if this bug is already documented. At least I want to do some
comments about what I have found.

I'm setting up my first slapd and I'm doing lots of

    dpkg-reconfigure slapd

(would be nice to see idempotent slapd querying style, but you have
different syntax for different moments; hence, you cannot "modify" if
the item is not created; buuh)

I see that I'm reaching this error

    Backup path /var/backups/unknown-2.4.44+dfsg-5+deb9u2.ldapdb exists.
Giving up...

and then database is not being reconfigured !

Very easy to reproduce, change the organization name (myorg) and after
that you won't see it with:

    root at host:/etc/ldap# grep -ir myorg *

but if you delete the database

    rm -rf /var/backups/unknown-2.4.44+dfsg-5+deb9u2.ldapdb

and `dpkg-reconfigure slapd` again:

    root at host:/etc/ldap# grep -ir myorg *
    slapd.d/cn=config/olcDatabase={1}mdb.ldif:olcSuffix: dc=myorg
    slapd.d/cn=config/olcDatabase={1}mdb.ldif:olcRootDN: cn=admin,dc=myorg



I'm new to debconf stuff so I started looking at it [1]. I appreciate if
you point me to a reference to understand it better.

It was a surprise to see the same function (that is related to this
bug), is in different files (is this in general for all debian
packages?). I thought that it should be just in one place and source it
to all this scripts - well, that's probably autogenerated and I would
like to know what is the official procedure of touching it. It would be
nice to know what is the script executed when I install (apt install
slapd) and when I dpkg-reconfigure it (ok, for dpkg-reconfigure it is
/var/lib/dpkg/info/slapd.postinst)

Well, inside that function, receive an argument that if is null then
"unknown" is set

    # Usage: move_old_database_away <dbdir> [<basedn>]
    suffix="${2:-unknown}"

trace is:

    compute_backup_path
    move_old_database_away
    create_new_configuration

as you see in [1]

is called without a second argument (hence, it is unknown)

    move_old_database_away /var/lib/ldap

if it is not unknown (putting an argument to it), the procedure is still
failing because the procedure does not able to handle multiple backups
in case of dealing with the same database (myorg or unknown for example)
- a workaround is necessary to fix this

Sorry, I feel I'm not reporting this appropiately. But I started looking
at this without having time and I wanted to share my findings; but I
know this looks like incomplete thing.

Cheers,
Pedro

[1]

 $ pwd
/var/lib/dpkg/info
 $ grep -ir move_old_database_away *
slapd.config:        move_old_database_away "$dbdir" "$suffix" <&5
slapd.config:move_old_database_away() {                        # {{{
slapd.config:# Usage: move_old_database_away <dbdir> [<basedn>]
slapd.config:        move_old_database_away /var/lib/ldap
slapd.postinst:        move_old_database_away "$dbdir" "$suffix" <&5
slapd.postinst:move_old_database_away() {                        # {{{
slapd.postinst:# Usage: move_old_database_away <dbdir> [<basedn>]
slapd.postinst:        move_old_database_away /var/lib/ldap
slapd.preinst:        move_old_database_away "$dbdir" "$suffix" <&5
slapd.preinst:move_old_database_away() {                        # {{{
slapd.preinst:# Usage: move_old_database_away <dbdir> [<basedn>]
slapd.preinst:        move_old_database_away /var/lib/ldap
slapd.prerm:        move_old_database_away "$dbdir" "$suffix" <&5
slapd.prerm:move_old_database_away() {                        # {{{
slapd.prerm:# Usage: move_old_database_away <dbdir> [<basedn>]
slapd.prerm:        move_old_database_away /var/lib/ldap





More information about the Pkg-openldap-devel mailing list