[Pkg-openldap-devel] Bug#594714: Bug#594714: slapd upgrade may fail on unset SLAPD_CONF

Matthijs Möhlmann matthijs at cacholong.nl
Mon Sep 6 21:31:48 UTC 2010


On 09/06/2010 09:38 PM, Steve Langasek wrote:
> On Sat, Aug 28, 2010 at 05:54:43PM +0200, Peter Marschall wrote:
>> upgrading slapd to 2.4.23-4 failed.
> 
>> Error message
>> -------------
>> (Reading database ... 244861 files and directories currently installed.)
>> Preparing to replace slapd 2.4.23-3pm1 (using slapd_2.4.23-4_amd64.deb) ...
>> Stopping OpenLDAP: slapd                                                                          [   OK   ]
>>   Dumping to /var/backups/slapd-2.4.23-3pm1: 
>> grep: /cn=config/olcDatabase*: No such file or directory
>> Unpacking replacement slapd ...
>> Setting up slapd (2.4.23-4) ...
>> Installing new version of config file /etc/init.d/slapd ...
>>   Moving old database directory to /var/backups:
>>   - directory unknown... done.
>>   Creating initial configuration... mkdir: missing operand
>> Try `mkdir --help' for more information.
>> dpkg: error processing slapd (--install):
>>  subprocess installed post-installation script returned error exit status 1
>> Processing triggers for man-db ...
>> Errors were encountered while processing:
>>  slapd
> 
> This seems to be a regression introduced in svn revision 1305:
> 
> Index: debian/slapd.scripts-common
> ===================================================================
> --- debian/slapd.scripts-common (revision 1304)
> +++ debian/slapd.scripts-common (revision 1305)
> @@ -755,14 +755,12 @@
>  fi
>  
>  # Load the default location of the slapd config file
> -if [ -z "$SLAPD_CONF" ]; then
> +if [ "${MODE}" = "configure" ] || [ -z "$SLAPD_CONF" ]; then
>         if previous_version_older 2.4.23-3 && \
>                 [ -f "/etc/ldap/slapd.conf" ] && \
>                 [ ! -e "/etc/ldap/slapd.d" ]; then
>  
>                 SLAPD_CONF="/etc/ldap/slapd.conf"
> -       else
> -               SLAPD_CONF="/etc/ldap/slapd.d"
>         fi
>  fi
>  
> The commit comment is:
> 
>  * Fix the upgrade procedure with the new slapd.defaults file.
> 
> Matthijs, I can't understand your intention here.  I'm sure that the last
> bit of the diff is wrong - we should *always* have a default fallback value
> for SLAPD_CONF, not just in the file-based case - but I don't understand the
> purpose of the first part of the diff.  In what case is it necessary to
> override an already-set SLAPD_CONF variable on configure, and why does this
> not also apply to other conditions besides "postinst configure"?
> 
> Without understanding that, I'm not sure what the right way is to clean this
> up.
> 
> Thanks,

Before 2.4.23-3 an empty value of SLAPD_CONF causes /etc/ldap/slapd.conf
automatically be chosen by the slapd process. After 2.4.23-3 we have a
sed one liner that automatically sets the SLAPD_CONF in the defaults
file. By *not* setting the SLAPD_CONF at that point people were able to
use /etc/ldap/slapd.conf as configuration style after version 2.4.23-3.

I had a conversation in a bug report with Peter, but I can't find the
bug log at this moment. I'll search tomorrow for it.

For fixing this bug: are we going to support the *legacy* format in any
way? If the answer is no, then the last part of that commit should be
reverted.

Regards,

Matthijs Mohlmann

PS: I'm sorry for the delay in responding, I had some busy days at work.





More information about the Pkg-openldap-devel mailing list