oliver at itc.li
Thu Aug 6 05:58:01 MDT 2009
Andrew Bartlett schrieb:
> On Wed, 2009-08-05 at 12:31 +0200, Oliver Liebel wrote:
>> running slapd-daemon:
>> - system is pre-checked if another instance of slapd is running on
>> system before starting it
>> - if no other slapd is running, slapdcommand_prov starts slapd (ldapi
>> only) for final provision
>> - after startup is verified, if slapd is up an listening on s4's ldapi_uri
>> after final provision finished:
>> - first is checked, if slapd is still running, listening to s4s ldapi_uri
>> - then slapd (with pid from paths.ldapdir/slapd.pid) will be terminated
>> (proper termination is re-checked)
>> - stored slapd-commandline is displayed to show the right syntax to
>> start slapd manually (except port )
> Thank-you so much for this work. I've been thinking about it, and the
> main thing I dislike is the way you try to detect another slapd process
> using ps and grep. Instead, how about trying a rootDSE search against
> the ldapi socket?
what about a simple bind via python-ldap to the socket?
that should do it too.
tested ist, seems ok.
> If it succeeds, then have the script fail with 'an
> ldap server appears to already be listening on .../ldapi, please shut it
> down before you continue'.
> I would really like to see the slapd process handled with the subprocess
> python module, but the best benefits of this (simply calling
> slapd.terminate() to kill the child) replies on the two parts being
you mean something like that:
retcode = call("mycmd" + " myarg", shell=True)
if retcode < 0:
print >>sys.stderr, "Child was terminated by signal", -retcode
print >>sys.stderr, "Child returned", retcode
except OSError, e:
print >>sys.stderr, "Execution failed:", e
> Andrew Bartlett
More information about the samba-technical