[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: NT port of slapd (ITS#869)

The simplest way to avoid this problem is to have the main function of slapd
set a flag to indicate that it has run and have the encapsulating service
function use this to avoid running main a second time.  Or the complete
"only-run-me-once" code could be kept in main.c.  Neither is elegant.

I am happy to prepare the patch for this if one of the above solutions is


----- Original Message -----
From: <jdhz@btinternet.com>
To: <openldap-its@OpenLDAP.org>
Sent: Thursday, November 02, 2000 1:48 PM
Subject: NT port of slapd (ITS#869)

> Full_Name: Jim Hud
> Version: 2.0.6
> OS: NT4 sp6
> URL:
> Submission from: (NULL) (
> When slapd is compiled with HAVE_NT_SERVICE_MANAGER and slapd is actually
run as
> a service, the main slapd routine (ServiceMain) is run twice, once when
> service starts and once when it stops.  This is because the logic in
> which decides if ServiceMain should be called uses
> which itself calls ServiceMain.
> ServiceMain is not tolerant of being called twice and the ldbm backend
causes a
> crash the second time it is run.  This is in ldbm_back_db_destroy which
does a
> free(be->be_private) which is NULL from the previous call.