Bug#888440: [Pkg-openldap-devel] Bug#888440: "dpkg-reconfigure slapd" fails if backup directory already exists
On Thu, Jan 25, 2018 at 06:05:44PM +0100, Floris Bos wrote: If you can guarantee us that the name of the folder we would need to delete is always /var/backups/unknown-2.4.44+dfsg-5+deb9u1.ldapdb -even in future package updates- that is a possibility. However would prefer not to make assumptions like that :-) Please don't. I do intend to fix at least the "unknown" part of that, sooner or later. ;) Can you tell me more about your use case here? It sounds like you have something automated, but in that case why are there multiple reconfigure runs involved (or any reconfigure at all)?
Bug#888440: [Pkg-openldap-devel] Bug#888440: "dpkg-reconfigure slapd" fails if backup directory already exists
On Thu, Jan 25, 2018 at 06:47:22PM +0100, Floris Bos wrote: That's pretty confusing as well. Yeah :/ You are right, in this case it only seems to have copied configuration to dump_database_destdir While the documentation suggests that directory is meant to dump the whole database to on upgrades: Right. The dumping machinery kicks in on upgrade - not on reconfigure. The fact it does dump (as well as copy) the config is a side-effect and not really intentional (but hopefully harmless).
Bug#888440: [Pkg-openldap-devel] Bug#888440: "dpkg-reconfigure slapd" fails if backup directory already exists
On 01/25/2018 05:54 PM, Ryan Tandy wrote: Nor an option to simply not move the thing, but delete it. We already have a dump of it, right? Not sure. We have a dump of the config, but I don't think it dumps the data, does it? That's pretty confusing as well. You are right, in this case it only seems to have copied configuration to dump_database_destdir While the documentation suggests that directory is meant to dump the whole database to on upgrades: == Template: slapd/dump_database Type: select __Choices: always, when needed, never Default: when needed _Description: Dump databases to file on upgrade: Before upgrading to a new version of the OpenLDAP server, the data from your LDAP directories can be dumped into plain text files in the standard LDAP Data Interchange Format. . Selecting "always" will cause the databases to be dumped unconditionally before an upgrade. Selecting "when needed" will only dump the database if the new version is incompatible with the old database format and it needs to be reimported. If you select "never", no dump will be done. Template: slapd/dump_database_destdir Type: string Default: /var/backups/slapd-VERSION _Description: Directory to use for dumped databases: Please specify the directory where the LDAP databases will be exported. In this directory, several LDIF files will be created which correspond to the search bases located on the server. Make sure you have enough free space on the partition where the directory is located. The first occurrence of the string "VERSION" is replaced with the server version you are upgrading from. == This can confuse unwitting users into thinking they do have a backup of everything, as the directory do is filled with .ldif files. Yours sincerely, Floris Bos
Bug#888440: [Pkg-openldap-devel] Bug#888440: "dpkg-reconfigure slapd" fails if backup directory already exists
Hi, On 01/25/2018 05:54 PM, Ryan Tandy wrote: On Thu, Jan 25, 2018 at 05:05:27PM +0100, Floris Bos wrote: I am not seeing any easy option to prevent this from happening. Removing the existing backup first isn't easy enough? If you can guarantee us that the name of the folder we would need to delete is always /var/backups/unknown-2.4.44+dfsg-5+deb9u1.ldapdb -even in future package updates- that is a possibility. However would prefer not to make assumptions like that :-) There is a preseed option (slapd/dump_database_destdir) to change the backup directory the database dump goes to, but that doesn't seem to affect the directory the old folder is moved to. Oh, really? If I understand you correctly, that sounds like a second bug - not respecting destdir for that location? It is respecting it for the destination of the database dump. But in addition to making a database dump, it also wants to move the original folder to /var/backups, and I do not see any option to change that destination. == # echo "slapd slapd/dump_database_destdir string /var/backups/just-testing" | debconf-set-selections # DEBIAN_FRONTEND=noninteractive dpkg-reconfigure slapd Backing up /etc/ldap/slapd.d in /var/backups/just-testing... done. Moving old database directory to /var/backups: Backup path /var/backups/unknown-2.4.44+dfsg-5+deb9u1.ldapdb exists. Giving up... == Yours sincerely, Floris Bos
Bug#888440: [Pkg-openldap-devel] Bug#888440: "dpkg-reconfigure slapd" fails if backup directory already exists
Control: forcemerge 757550 -1 Hello Floris, Thank you for the report. I'm merging it with an existing ticket that tracks the same issue. On Thu, Jan 25, 2018 at 05:05:27PM +0100, Floris Bos wrote: I am not seeing any easy option to prevent this from happening. Removing the existing backup first isn't easy enough? There is a preseed option (slapd/dump_database_destdir) to change the backup directory the database dump goes to, but that doesn't seem to affect the directory the old folder is moved to. Oh, really? If I understand you correctly, that sounds like a second bug - not respecting destdir for that location? Nor an option to simply not move the thing, but delete it. We already have a dump of it, right? Not sure. We have a dump of the config, but I don't think it dumps the data, does it? I'm ok with moving stuff around but highly hesitant to actually delete... That should be the admin's choice. I would never want to be responsible for data loss. thanks, Ryan