Issue 8726 - slapd -d pcache not available when pcache is a module
Summary: slapd -d pcache not available when pcache is a module
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: overlays (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: 2.5.3
Assignee: Howard Chu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-07 21:32 UTC by adam@brainfood.com
Modified: 2021-04-01 04:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description adam@brainfood.com 2017-09-07 21:32:12 UTC
Full_Name: Adam Heath
Version: 
OS: debian stretch
URL: 
Submission from: (NULL) (99.146.168.62)


1: In slapd/main.c, parse_debug_level adds 'pcache' to the global
debug_unknowns.
2: main() then calls read_config()
3: eventually, overlay pcache is read from the config file
4: pcache calls slap_loglevel_get, to configure it's static int pcache_debug
5: pcache calls config_register_schema, so the pcache config options can be
parsed
6: eventually, pcache:pc_cf_gen() is called, to handle the pcacheTemplate
option
7: pc_cf_gen calls Debug(pcache_debug)
8: back in main(), immediately after read_config(), parse_debug_unknowns is
called to add the enabled debug levels into the global slapd_debug bit mask.

It'd be nice if I could see the pcache_debug calls when pcache is configured as
a module, instead of having to statically compile it into slapd.

If I use "-d -1", then I *do* see those pcache_debug calls, but then I also see
*everything else*.
Comment 1 adam@brainfood.com 2017-09-07 22:03:15 UTC
After further reading of the code, in ldap_log.h, I see LDAP_DEBUG
options that are no longer supported(_CACHE and _INDEX).  Based on
that, I then specify -d 4096, and now I see the debug logs from
pcache.  This is because that's the first mask value discovered that
is not used by the known log levels.

However, that depends on the ordering of the modules, which seems
fraught with error.

On Thu, Sep 7, 2017 at 4:32 PM,  <openldap-its@openldap.org> wrote:
>
> *** THIS IS AN AUTOMATICALLY GENERATED REPLY ***
>
> Thanks for your report to the OpenLDAP Issue Tracking System.  Your
> report has been assigned the tracking number ITS#8726.
>
> One of our support engineers will look at your report in due course.
> Note that this may take some time because our support engineers
> are volunteers.  They only work on OpenLDAP when they have spare
> time.
>
> If you need to provide additional information in regards to your
> issue report, you may do so by replying to this message.  Note that
> any mail sent to openldap-its@openldap.org with (ITS#8726)
> in the subject will automatically be attached to the issue report.
>
>         mailto:openldap-its@openldap.org?subject=(ITS#8726)
>
> You may follow the progress of this report by loading the following
> URL in a web browser:
>     http://www.OpenLDAP.org/its/index.cgi?findid=8726
>
> Please remember to retain your issue tracking number (ITS#8726)
> on any further messages you send to us regarding this report.  If
> you don't then you'll just waste our time and yours because we
> won't be able to properly track the report.
>
> Please note that the Issue Tracking System is not intended to
> be used to seek help in the proper use of OpenLDAP Software.
> Such requests will be closed.
>
> OpenLDAP Software is user supported.
>         http://www.OpenLDAP.org/support/
>
> --------------
> Copyright 1998-2007 The OpenLDAP Foundation, All Rights Reserved.
>

Comment 2 Quanah Gibson-Mount 2021-03-01 17:52:56 UTC
Issue is startup pcache debug statements are not logged.
Comment 3 Howard Chu 2021-03-21 16:37:48 UTC
fixed in master
Comment 4 Quanah Gibson-Mount 2021-03-21 19:39:32 UTC
Commits: 
  • cbb6441c 
by Howard Chu at 2021-03-21T16:36:30+00:00 
ITS#8726 check newly registered loglevels immediately