[Pkg-openldap-devel] Bug#517556: Bug#517556: upgrading slapd fails with multiple databases and dbconfig settings in slapd.conf

Steve Langasek vorlon at debian.org
Sun Mar 8 21:09:21 UTC 2009


Hi Peter,

On Sat, Feb 28, 2009 at 05:20:55PM +0100, Peter Marschall wrote:
> on an update from versions below 2.1.14 slapd 2.1.15's postinst script
> dumps and reloads the databases.
> When trying to relaod the databases the postinst script checks whether the
> database directory is empty.
> Unfortunately this fails on the second database when slapd.conf contains
> "dbconfig" settings.

> Cause:
> When creating the first database slapadd creates DB_CONFIG files in the
> directories of all databases with "dbconfig" settings in slapd.conf.

> The attached patch changes the reload routine so that it accepts a
> DB_CONFIG in an otherwise empty directory. This makes the upgrade.

> This - freshly created - DB_CONFIG file will not be overwritten from
> a DB_CONFIG file from the backup (rationale: the admin gave these values
> in slapd.conf - no need to get something back from backup).

> In addition to that the patch fixes a warning message generated by find
> because of the wrong order of parameters.

Thanks for this patch.  I'm pondering whether adding this new function is
the right thing to do, as opposed to simply redefining is_empty_dir - is
there any reason we should ever treat a directory with only DB_CONFIG in it
as non-empty?

For that matter, doesn't this patch result in different behavior for the
first database (restoring DB_CONFIG from the backup) vs. the subsequent
databases (using the DB_CONFIG autogenerated from slapd.conf)?  Once we
decide on a consistent behavior here, I think it's possible to always ignore
DB_CONFIG when detecting non-empty dirs, simplifying the code.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org





More information about the Pkg-openldap-devel mailing list