Bug 16801 - openldap update does not properly restart slapd service
Summary: openldap update does not properly restart slapd service
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Buchan Milne
QA Contact:
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2015-09-22 10:28 CEST by Colin Guthrie
Modified: 2019-05-12 13:06 CEST (History)
4 users (show)

See Also:
Source RPM: openldap
CVE:
Status comment:


Attachments

Description Colin Guthrie 2015-09-22 10:28:56 CEST
When updating the openldap service, on both my machines using it (one MGA4 one MGA5), both ended up after the upgrade with the service stopped.

MGA5:

    11/27: openldap              ####################
    12/27: lib64ldap2.4_2        ####################
Using /etc/openldap/slapd.conf as configuration for %pre servers
Stopping slapd.service via systemd and recovering via ldap-config
Running /usr/bin/slapd_db_recover on /var/lib/ldap
removing /var/lib/ldap/alock
    13/27: openldap-servers      ####################


MGA4:
    30/66: openldap              ####################
    31/66: lib64ldap2.4_2        ####################
    32/66: openldap-back_bdb     ####################
Using /etc/openldap/slapd.conf as configuration for %pre servers
Stopping slapd.service via systemd and recovering via ldap-config
Running /usr/bin/slapd_db_recover on /var/lib/ldap
removing /var/lib/ldap/alock
    33/66: openldap-servers      ####################


This is because migration code in the spec stops it in the %pre (hence why the debug messages appear before the -servers subpackage), but the %post does not start it again (I think it relies on a very old /var/lock/subsys type method for triggering start in %post). We need some other mechanism of communicating from %pre to %post that service start is required.

This should be a blocker on any further openldap updates.

Reproducible: 

Steps to Reproduce:
Comment 1 Samuel Verschelde 2015-09-28 11:49:13 CEST
The maintainer is bgmilne, that I'm adding in CC, but he's not been active recently on this package according to the commit logs.

Adding other committers in CC too.

CC: (none) => bgmilne, luigiwalser, mageia

Comment 2 David Walser 2015-09-28 15:18:51 CEST
You should feel fortunate if it still works after the upgrade at all (if you manually restart it).  This package hasn't changed substantially in probably 15 years and about 50% of the time when I've done a Mandrake/Mandriva/Mageia upgrade, I've had to recreate my LDAP db from LDIFs since it completely broke.  There are other more recent known issues with this package as well.  We'd probably be best served to resync it with Fedora.
Comment 3 Nicolas Lécureuil 2015-09-28 16:21:11 CEST
i will take a look to this package as i use it at work.
Comment 4 Marja Van Waes 2017-04-19 10:02:34 CEST
(In reply to Nicolas Lécureuil from comment #3)
> i will take a look to this package as i use it at work.

Is this bug still valid?

If so, only in Mageia 5 or also (if you happen to know) in Cauldron?

Assignee: bugsquad => mageia
CC: (none) => marja11
Keywords: (none) => NEEDINFO

Comment 5 Buchan Milne 2017-04-24 15:08:56 CEST
I will try and test upgrade from 5 to cauldron this week, and address any issues then.

Note that the reason for doing this is mainly due to ensuring migration of consistent backups in the event that an import needs to be done due to either:
- incompatibility of the database library (or version) used in the supported backends
- migrating from deprecated backends (e.g. from lmdb to bdb)

(Having slapd not running but having a working db is IMHO worse than not being able to start slapd with the current database files because migration wasn't done, and I haven't ever seen the migration fail. Of course, it would be best to have it running after the upgrade, even if we expect the user to reboot soon afterwards)

There is an outstanding TODO item, to migrate from the deprecated bdb to using mdb/lmdb by default, so we can't remove the migration feature yet.

Prior to Mageia 4, bdb and hdb were built-in, http://svnweb.mageia.org/packages?view=revision&revision=563724 changed them to modules and ship in separate packages, and introduced requirements on the backend packages to force the installation of the backend packages.

So, it may not (yet) be necessary to migrate users off of bdb and/or hdb, but performance on lmdb should be better (and we should probably rather default to mdb rather than the change to hdb by @neoclust), so maybe we should migrate bdb to mdb by default (unless the users has indicated to not have automatic migration by setting AUTOMIGRATE to anything but 'yes' in /etc/sysconfig/slapd). The other question is whether to migrate hdb as well. I would prefer to be consistent here, and migrate everything to mdb rather than having too many cases to test.

Maybe once all supported versions should be on lmdb, we may be able to remove the migration feature (assuming new versions of lmdb never require slapcat/slapadd to upgrade).

Status: NEW => ASSIGNED

Comment 6 Marja Van Waes 2018-09-12 20:29:14 CEST
(Reassigning to Buchan, who was working on this, according to comment 5)

This bug was filed against Mageia 5.
Mageia 5 has officially reached its End of Life on December 31st, 2017 https://blog.mageia.org/en/2017/11/07/mageia-5-eol-postponed/
It continued to get limited extended support since then, but that support has now ended, too.
As a result we are closing this bug report as OLD.

Did this bug get fixed in Mageia 5? If so, please change its status to RESOLVED - FIXED

If this bug still exists in a supported Mageia version or cauldon, then please reopen this report.

Status: ASSIGNED => RESOLVED
Assignee: mageia => bgmilne
Resolution: (none) => OLD

Comment 7 David Walser 2018-09-12 21:33:03 CEST
Assigning back to Nicolas (see Comment 3).  This still needs addressed.

Version: 5 => Cauldron
Assignee: bgmilne => mageia

David Walser 2018-09-12 21:35:16 CEST

Status: RESOLVED => REOPENED
Resolution: OLD => (none)

Nicolas Lécureuil 2019-02-19 10:13:08 CET

Assignee: mageia => bgmilne

Comment 8 Buchan Milne 2019-05-12 13:06:14 CEST
This should be fixed for cauldron as of commit 1397399 ( http://svnweb.mageia.org/packages/cauldron/openldap/current/SPECS/openldap.spec?r1=1357007&r2=1397399 ) or openldap-2.4.47-3.mga7 (currently building).

Resolution: (none) => FIXED
Status: REOPENED => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.