[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
acceptable.

Jim


----- 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) (195.92.194.30)
>
>
> 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
the
> service starts and once when it stops.  This is because the logic in
nt_svc.c
> which decides if ServiceMain should be called uses
StartServiceCtrlDispatcher
> 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.
>
>
>
>