Your message dated Mon, 13 Sep 2010 07:47:24 +0000
with message-id <e1ov3l6-0001dv...@franck.debian.org>
and subject line Bug#596100: fixed in openldap 2.4.23-5
has caused the Debian Bug report #596100,
regarding When told not to initially configure slapd, (un-)installation fails 
due to init script return code.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
596100: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=596100
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: slapd
Version: 2.4.23-4
Severity: normal
Tags: patch

If slapd is told not to create an initial configuration, the init script
fails and kills apt-get in its death throes.

aginor:~# debconf-set-selections 
slapd   slapd/internal/adminpw  password        insecure
slapd   slapd/internal/generated_adminpw        password        insecure
slapd   slapd/password2 password        insecure
slapd   slapd/password1 password        insecure
slapd   slapd/no_configuration  boolean true

aginor:~# apt-get install slapd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Recommended packages:
  libsasl2-modules
The following NEW packages will be installed
  slapd
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0B/1,584kB of archives.
After this operation, 4,006kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package slapd.
(Reading database ... 23942 files and directories currently installed.)
Unpacking slapd (from .../slapd_2.4.23-4_amd64.deb) ...
Processing triggers for man-db ...
Setting up slapd (2.4.23-4) ...
  Omitting slapd configuration as requested.
No configuration file was found for slapd at /etc/ldap/slapd.d. ... (warning).
invoke-rc.d: initscript slapd, action "start" failed.
dpkg: error processing slapd (--configure):
 subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
                                      Errors were encountered while processing:
 slapd
E: Sub-process /usr/bin/dpkg returned an error code (1)
aginor:~#


Attempting to immediately remove the package also fails hard.

aginor:~# dpkg --purge slapd
(Reading database ... 24183 files and directories currently installed.)
Removing slapd ...
No configuration file was found for slapd at /etc/ldap/slapd.d. ... (warning).
invoke-rc.d: initscript slapd, action "stop" failed.
dpkg: error processing slapd (--purge):
 subprocess installed pre-removal script returned error exit status 1
  Backing up /etc/ldap/slapd.d in /var/backups/slapd-... done.
grep: /etc/ldap/slapd.d/cn=config/olcDatabase*: No such file or directory
No configuration file was found for slapd at /etc/ldap/slapd.d. ... (warning).
invoke-rc.d: initscript slapd, action "start" failed.
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 slapd
aginor:~#



The included patch solves this by:

1) Creating /etc/ldap/noslapd as part of the postinst which the administrator
   can remove when slapd is configured.

2) Shuffling the init script to deal with the sentinel file more
   gracefully. This is done by having functions defined in multiple places,
   which I am not keen on but it Does The Job.



diff -ur openldap-2.4.23/debian/slapd.init openldap-2.4.23-changed/debian/slapd.init
--- openldap-2.4.23/debian/slapd.init	2010-09-08 17:38:43.000000000 +0100
+++ openldap-2.4.23-changed/debian/slapd.init	2010-09-08 16:11:14.000000000 +0100
@@ -38,10 +38,39 @@
 	SLAPD_CONF="/etc/ldap/slapd.conf"
 fi
 
+# Check whether we were configured to not start the services.
+check_for_no_start() {
+	# Paradoxically, return 0 (success) when not configured to
+	# start (that is - no_start is true, which in sh-speak is 0)
+	if [ -n "$SLAPD_NO_START" ]; then
+		no_start="SLAPD_NO_START set in /etc/default/slapd"
+		return 0
+	elif [ -n "$SLAPD_SENTINEL_FILE" -a -e "$SLAPD_SENTINEL_FILE" ]; then
+		no_start="$SLAPD_SENTINEL_FILE exists"
+		return 0
+	else
+		return 1
+	fi
+}
+
+# ... and say so
+report_no_start() {
+	if check_for_no_start; then
+		echo "Not starting slapd: $no_start" >&2
+		exit 0
+	fi
+}
+
 # Stop processing if the config file is not there
 if [ ! -r "$SLAPD_CONF" ]; then
-  log_warning_msg "No configuration file was found for slapd at $SLAPD_CONF."
-  exit 1
+	log_warning_msg "No configuration file was found for slapd at $SLAPD_CONF."
+	# If slapd is restricted from starting, its lack of
+	# configuration is not an error
+	if check_for_no_start; then
+		exit 0
+	else
+		exit 1
+	fi
 fi
 
 # Find out the name of slapd's pid file
@@ -84,18 +113,6 @@
 	SLAPD_OPTIONS="-g $SLAPD_GROUP $SLAPD_OPTIONS"
 fi
 
-# Check whether we were configured to not start the services.
-check_for_no_start() {
-	if [ -n "$SLAPD_NO_START" ]; then
-		echo 'Not starting slapd: SLAPD_NO_START set in /etc/default/slapd' >&2
-		exit 0
-	fi
-	if [ -n "$SLAPD_SENTINEL_FILE" ] && [ -e "$SLAPD_SENTINEL_FILE" ]; then
-		echo "Not starting slapd: $SLAPD_SENTINEL_FILE exists" >&2
-		exit 0
-	fi
-}
-
 # Tell the user that something went wrong and give some hints for
 # resolving the problem.
 report_failure() {
@@ -165,12 +182,12 @@
 
 case "$1" in
   start)
-	check_for_no_start
+	report_no_start
   	start_ldap ;;
   stop)
   	stop_ldap ;;
   restart|force-reload)
-	check_for_no_start
+	report_no_start
   	stop_ldap
 	start_ldap
 	;;
diff -ur openldap-2.4.23/debian/slapd.postinst openldap-2.4.23-changed/debian/slapd.postinst
--- openldap-2.4.23/debian/slapd.postinst	2010-09-08 17:38:43.000000000 +0100
+++ openldap-2.4.23-changed/debian/slapd.postinst	2010-09-08 16:12:18.000000000 +0100
@@ -14,6 +14,8 @@
 
 	if manual_configuration_wanted; then
 		echo "  Omitting slapd configuration as requested." >&2
+		echo "  Touching /etc/ldap/noslapd so slapd will not attempt to start." >&2
+		touch /etc/ldap/noslapd
 	else
 		crypt_admin_pass
 		create_new_configuration

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.34 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages slapd depends on:
ii  adduser                   3.112          add and remove users and groups
ii  coreutils                 8.5-1          GNU core utilities
ii  debconf [debconf-2.0]     1.5.35         Debian configuration management sy
ii  libc6                     2.11.2-2       Embedded GNU C Library: Shared lib
ii  libdb4.8                  4.8.30-2       Berkeley v4.8 Database Libraries [
ii  libgnutls26               2.8.6-1        the GNU TLS library - runtime libr
ii  libldap-2.4-2             2.4.23-4       OpenLDAP libraries
ii  libltdl7                  2.2.6b-2       A system independent dlopen wrappe
ii  libperl5.10               5.10.1-14      shared Perl library
ii  libsasl2-2                2.1.23.dfsg1-5 Cyrus SASL - authentication abstra
ii  libslp1                   1.2.1-7.8      OpenSLP libraries
ii  libwrap0                  7.6.q-19       Wietse Venema's TCP wrappers libra
ii  lsb-base                  3.2-23.1       Linux Standard Base 3.2 init scrip
ii  perl [libmime-base64-perl 5.10.1-14      Larry Wall's Practical Extraction 
ii  psmisc                    22.11-1        utilities that use the proc file s
ii  unixodbc                  2.2.14p2-1     ODBC tools libraries

Versions of packages slapd recommends:
pn  libsasl2-modules              <none>     (no description available)

Versions of packages slapd suggests:
ii  ldap-utils                    2.4.23-4   OpenLDAP utilities


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.34 (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages slapd depends on:
ii  adduser                 3.112            add and remove users and groups
ii  coreutils               8.5-1            GNU core utilities
ii  debconf [debconf-2.0]   1.5.35           Debian configuration management sy
ii  libc6                   2.11.2-2         Embedded GNU C Library: Shared lib
ii  libdb4.8                4.8.30-2         Berkeley v4.8 Database Libraries [
ii  libgnutls26             2.8.6-1          the GNU TLS library - runtime libr
ii  libldap-2.4-2           2.4.23-4monnsta1 OpenLDAP libraries
ii  libltdl7                2.2.6b-2         A system independent dlopen wrappe
ii  libperl5.10             5.10.1-14        shared Perl library
ii  libsasl2-2              2.1.23.dfsg1-6   Cyrus SASL - authentication abstra
ii  libslp1                 1.2.1-7.8        OpenSLP libraries
ii  libwrap0                7.6.q-19         Wietse Venema's TCP wrappers libra
ii  lsb-base                3.2-23.1         Linux Standard Base 3.2 init scrip
ii  perl [libmime-base64-pe 5.10.1-14        Larry Wall's Practical Extraction 
ii  psmisc                  22.11-1          utilities that use the proc file s
ii  unixodbc                2.2.14p2-1       ODBC tools libraries

Versions of packages slapd recommends:
pn  libsasl2-modules              <none>     (no description available)

Versions of packages slapd suggests:
ii  ldap-utils              2.4.23-4monnsta1 OpenLDAP utilities


-- 
I must take issue with the term "a mere child", for it has been my
invariable experience that the company of a mere child is infinitely
preferable to that of a mere adult.
                                           --  Fran Lebowitz

--- End Message ---
--- Begin Message ---
Source: openldap
Source-Version: 2.4.23-5

We believe that the bug you reported is fixed in the latest version of
openldap, which is due to be installed in the Debian FTP archive:

ldap-utils_2.4.23-5_amd64.deb
  to main/o/openldap/ldap-utils_2.4.23-5_amd64.deb
libldap-2.4-2-dbg_2.4.23-5_amd64.deb
  to main/o/openldap/libldap-2.4-2-dbg_2.4.23-5_amd64.deb
libldap-2.4-2_2.4.23-5_amd64.deb
  to main/o/openldap/libldap-2.4-2_2.4.23-5_amd64.deb
libldap2-dev_2.4.23-5_amd64.deb
  to main/o/openldap/libldap2-dev_2.4.23-5_amd64.deb
openldap_2.4.23-5.diff.gz
  to main/o/openldap/openldap_2.4.23-5.diff.gz
openldap_2.4.23-5.dsc
  to main/o/openldap/openldap_2.4.23-5.dsc
slapd-dbg_2.4.23-5_amd64.deb
  to main/o/openldap/slapd-dbg_2.4.23-5_amd64.deb
slapd-smbk5pwd_2.4.23-5_amd64.deb
  to main/o/openldap/slapd-smbk5pwd_2.4.23-5_amd64.deb
slapd_2.4.23-5_amd64.deb
  to main/o/openldap/slapd_2.4.23-5_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 596...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Steve Langasek <vor...@debian.org> (supplier of updated openldap package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 13 Sep 2010 06:59:11 +0000
Source: openldap
Binary: slapd slapd-smbk5pwd ldap-utils libldap-2.4-2 libldap-2.4-2-dbg 
libldap2-dev slapd-dbg
Architecture: source amd64
Version: 2.4.23-5
Distribution: unstable
Urgency: high
Maintainer: Debian OpenLDAP Maintainers 
<pkg-openldap-de...@lists.alioth.debian.org>
Changed-By: Steve Langasek <vor...@debian.org>
Description: 
 ldap-utils - OpenLDAP utilities
 libldap-2.4-2 - OpenLDAP libraries
 libldap-2.4-2-dbg - Debugging information for OpenLDAP libraries
 libldap2-dev - OpenLDAP development libraries
 slapd      - OpenLDAP server (slapd)
 slapd-dbg  - Debugging information for the OpenLDAP server (slapd)
 slapd-smbk5pwd - Keeps Samba and Kerberos passwords in sync within slapd.
Closes: 593880 593965 594712 594714 594821 595466 595672 595784 596049 596100 
596326 596343
Changes: 
 openldap (2.4.23-5) unstable; urgency=high
 .
   [ Steve Langasek ]
   * High-urgency upload for RC bugfix.
   * debian/slapd.scripts-common: fix gratuitous (and wrong) use of grep in
     get_suffix(), which causes us to incorrectly parse any slapd.conf that
     uses tabs instead of spaces.  Closes: #595672.
   * debian/slapd.init, debian/slapd.scripts-common: when $SLAPD_CONF is not
     set in /etc/default/slapd, we should always set a default value, giving
     precedence to slapd.d and falling back to slapd.conf.  Users who don't
     want to use an existing slapd.d should point at slapd.conf explicitly.
     Closes: #594714, #596343.
   * debian/slapd.init: 'invoke-rc.d slapd stop' should not fail due to the
     absence of a slapd configuration; we should still exit 0 so that the
     package can be removed gracefully.  Closes: #596100.
   * drop build-conflicts with libssl-dev; we explicitly pass
     --with-tls=gnutls to configure, so there's no risk of a misbuild here.
   * debian/slapd.default: now that we have a sensible default behavior in
     both slapd.init and the maintainer scripts, leave SLAPD_CONF empty to
     save pain later.
   * debian/slapd.scripts-common: ... and do the same in
     migrate_to_slapd_d_style, we just need to comment out the user's
     previous entry instead of blowing it away.
   * debian/slapd.scripts-common: call get_suffix in a way that lets us
     separate responses by newlines, to properly handle the case when a
     DN has embedded spaces.  Introduces a few more stupid fd tricks to work
     around possible problems with debconf.  Closes: #595466.
   * debian/slapd.scripts-common: when parsing the names of includes, handle
     double-quotes and escape characters as described in slapd.conf(5).
     Closes: #595784.
   * debian/slapd.scripts-common, debian/slapd.postinst: on upgrade from
     versions <= 2.4.23-4, explicitly grant access to cn=Subschema, which
     otherwise is blocked by our added olcAccess settings.  Closes: #596326.
   * debian/slapd.init.ldif: set the acl in the default LDIF for new installs,
     too.
   * Likewise, grant access to dn.exact="" so that base dn autodiscovery
     works as intended.  Closes: #596049.
   * debian/slapd.init.ldif: synchronize our behavior on new installs with
     that on upgrades, avoiding the non-standard cn=localroot,cn=config.
   * debian/slapd.scripts-common: don't run the migration code if slapd.d
     already exists.  Closes: #593965.
 .
   [ Matthijs Mohlmann ]
   * Remove upgrade_supported_from_backend, implemented patch from
     Peter Marschall <pe...@adpm.de> to automatically detect if an upgrade is
     supported. (Closes: #594712)
 .
   [ Peter Marschall ]
   * debian/slapd.init: correctly set the slapd.conf argument even when
     SLAPD_PIDFILE is non-empty in /etc/default/slapd.  Closes: #593880.
   * debian/slapd.scripts-common: pass -g to slapadd/slapcat, so that
     subordinate databases aren't incorrectly included in the dump/restore of
     the parent database.  Closes: #594821.
Checksums-Sha1: 
 5daa15905560610dfe91fa79aa6a87f6181befc1 2494 openldap_2.4.23-5.dsc
 cbf427e7865fdfe5d85cc08397cd9856be1a2148 154414 openldap_2.4.23-5.diff.gz
 02421d3733f7825c06963c602f8bc4b65fbea14c 1599352 slapd_2.4.23-5_amd64.deb
 9a3ecfc2102db54f3a2bc203ffac1b08df0c0e9e 58788 
slapd-smbk5pwd_2.4.23-5_amd64.deb
 9eb07c8647c016152d5ee3b79b3bd7881244d9ea 327490 ldap-utils_2.4.23-5_amd64.deb
 a35645a516766fca1b9d4e89ba4d5c1fe1ad71ce 210400 
libldap-2.4-2_2.4.23-5_amd64.deb
 5d61ba023f74df9b2241353986646bfa58cc31fc 305674 
libldap-2.4-2-dbg_2.4.23-5_amd64.deb
 92d1092dff19d759ac23c3ffe93afecd4af88d72 1005512 
libldap2-dev_2.4.23-5_amd64.deb
 7b6bb0dd28c91107a8f55e9331909986ff0517f1 4029056 slapd-dbg_2.4.23-5_amd64.deb
Checksums-Sha256: 
 14f5a41a788829c6a8d5f107fe288004e8a90f420741a3239c53bce1e8a0788c 2494 
openldap_2.4.23-5.dsc
 a13e79d790d384ce6a7fe3c5c2cdaf6e6ca0f5b770a8d7898d3d341c2e507c21 154414 
openldap_2.4.23-5.diff.gz
 370859a63c128671ba05e2ac1f95688833fde2eea0f3cbe796349157817ff6b5 1599352 
slapd_2.4.23-5_amd64.deb
 d448b5b5e03b76a8b572416759ad60ac7ba8845d0f41e056f0dcc379a9b40cd9 58788 
slapd-smbk5pwd_2.4.23-5_amd64.deb
 c545948750ba38eb0640a7233bbb645374e6a07a09cfa10978ec1cfd8264ad5e 327490 
ldap-utils_2.4.23-5_amd64.deb
 fe116b5a74969c48ec34c3f6581e3280a63c0e3ac0c723b4e8c6006ea4e58b2e 210400 
libldap-2.4-2_2.4.23-5_amd64.deb
 1fa7a6d9d6281231d6f106a94df1b1f573bfef515f7606cf01489ed72e1c4958 305674 
libldap-2.4-2-dbg_2.4.23-5_amd64.deb
 7f28ac1e3b5e04a58027123350e7605e5f8f9c825f0c562aebfae51b05eb1ba3 1005512 
libldap2-dev_2.4.23-5_amd64.deb
 6a9f2777c894046ac54b380806fbf4f612768ab82b4affda7fc90cc7ecd1c55c 4029056 
slapd-dbg_2.4.23-5_amd64.deb
Files: 
 d6d84f5dd8dce32dcbc97a9d41f75eed 2494 net optional openldap_2.4.23-5.dsc
 aa594c7818180c30d0d26b4d983c3e44 154414 net optional openldap_2.4.23-5.diff.gz
 707f3426c02a39a7776dfe7d13a34568 1599352 net optional slapd_2.4.23-5_amd64.deb
 05519eb85dfc445832d59d4d18dbd610 58788 net extra 
slapd-smbk5pwd_2.4.23-5_amd64.deb
 22afc9f5ace7b7f8d55379175896695a 327490 net optional 
ldap-utils_2.4.23-5_amd64.deb
 f9b9237f4bbb61a93cf0623ba20e39c8 210400 libs standard 
libldap-2.4-2_2.4.23-5_amd64.deb
 36b4492afe4d46f923638030f0e08fa6 305674 debug extra 
libldap-2.4-2-dbg_2.4.23-5_amd64.deb
 a6fe7aed318adc7492071ac71358c807 1005512 libdevel extra 
libldap2-dev_2.4.23-5_amd64.deb
 3a1afff7a5685a99bb8395e6c8097bdc 4029056 debug extra 
slapd-dbg_2.4.23-5_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIVAwUBTI3OElaNMPMhshM9AQj1kRAAyErdy+fv1EfcXjTxd+/M5yWP1fkzHJ8T
Z/5h5ijGNeF6e44djeFWC/DigeU16+RCW6Ofy7gDVOjF55dPGOjqL20lMXyGopkr
XVv8zmGaDHgJNDONWBzqBiUGPs+ddPTdlyx/2OcdyvqScD5yHjXYPJxYls/DWiXk
opXCHrVnFqsAetQrvXG7ZPual8jyGMorXWiCSNVvlVoVdnEree92NEMaTB6Qavw4
nd/Qb8brkPqs7tIpN535MqfuSAqfGxdcJ7hDVkPbWrNrnK2YpE97/pPn5lZPWy0b
4B0SZv9TLYQ9tKSJxcobHWNYtZvRd1qX74U24gXEJGHzBtbc+/LWydT3mYFczbCp
+vFtd0jrDH8JLfjMUhtRUdsr8BjCzG2OSkKwhO7fnQDW0WSkPpOBx+uXC3ugESr2
M04+OnSFw52p2G33q536xnhFqFWNrvCRExoXWgrWuRLYfCxZ+MzDcnUkUL6qW0zN
2mCMCOmWbqz4H+GJCxLJrAeCbB+U06ZmVMmVIyveo9SvJHy8rBVIkBzUo2FBzMJd
DK5aJ3fq+NLEOK5391NTQpVqlWCnIVWsIBls9xPt1j8KSNSNl/SXhpOgsDRHmIpN
RvOwqgD/jILoUpQsHbGVLd5Djb+edVB3aXGsyf/FbFcFItiAdeGg2EQWVJ8UpHsq
b5xsXQ0sPyg=
=hvMt
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to