Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Nov 2004 12:35:47 -0800
From:      Sean McNeil <sean@mcneil.com>
To:        Dick Davies <rasputnik@hellooperator.net>
Cc:        Ivan Voras <ivoras@fer.hr>
Subject:   Re: openldap slapd startup delay
Message-ID:  <1100723747.18003.4.camel@server.mcneil.com>
In-Reply-To: <20041117135058.GB28461@lb.tenfour>
References:  <419B3DA9.8020202@fer.hr>  <20041117135058.GB28461@lb.tenfour>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-xRiI3PtSTGkJadsgLx3i
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Wed, 2004-11-17 at 13:50 +0000, Dick Davies wrote:
> * Ivan Voras <ivoras@fer.hr> [1124 13:24]:
> > I'm running pam_ldap & nss_ldap fine, but there's a huge delay when=20
> > slapd starts (upto 30sec.). During the delay there's no load on the=20
> > machine, and it's listening on hosts that are name-resolvable via=20
> > /etc/hosts (it has priority in /etc/nsswitch.conf).
>=20
> I saw this for the past three weeks - it appears to be a problem with
> the rc script. If you run 'ps awwux'and copy the command line shown to
> a script, it starts straight away.
>=20
>=20
> I replaced it with this, which starts instantly :
>=20
>=20
> root@eris exim # less /usr/local/etc/rc.d/000._slappy.sh=20
> #!/bin/sh
>=20
> # please don't mistake me for someone who gives a shit that I check a pid=
file
> # twice in the stop function, I am too old and lazy to learn shell.
>=20
>=20
> DAEMON=3D"/usr/local/libexec/slapd"
> PIDFILE=3D"/var/run/openldap/slapd.pid"
> CFG=3D"/usr/local/etc/openldap/slapd.conf"
> FLAGS=3D'-h ldaps://ldap.domain/ ldap://ldap.domain -u ldap -g ldap'
>=20
>=20
> case $1 in
> start)
>     [ -x ${DAEMON} ] && {
>         echo -n ' starting slapd'
>         ${DAEMON} ${FLAGS}
>     }
>     ;;
>=20
> stop)
>     [ -f ${PIDFILE} ] || ( echo ' slapd not running? (no ${PIDFILE})' && =
exit )
>     [ -f ${PIDFILE} ] && {
>         echo -n ' stopping slapd'
>         kill `cat ${PIDFILE}`
>     }
>     ;;
>=20
> restart)
>         stop
> 				start
>     ;;
>=20
> *)
>     echo "usage: `basename $0` {start|stop|restart}" >&2
>     exit 64
>     ;;
> esac

Does this fix the start delay, or the problem with stop?  I have traced
through the start delay and found it is because slapd is opening the
socket and then there is a lookup on group which causes it to try to
read from slapd and you are in a deadlock until the socket times out.
This has always been normal for me (the delay on startup) and others.

Sean


--=-xRiI3PtSTGkJadsgLx3i
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iD8DBQBBm7YjyQsGN30uGE4RAhwUAJ4oDJ4Nra9FrtGmKdEhjSGLKQQkqwCfeF3m
qasohNBcY3dd6i5NggK6Jgs=
=TSCg
-----END PGP SIGNATURE-----

--=-xRiI3PtSTGkJadsgLx3i--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1100723747.18003.4.camel>