From owner-freebsd-current@FreeBSD.ORG Wed Nov 17 20:35:57 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 706DA16A4CE for ; Wed, 17 Nov 2004 20:35:57 +0000 (GMT) Received: from mail.mcneil.com (mcneil.com [24.199.45.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 223BA43D2F for ; Wed, 17 Nov 2004 20:35:57 +0000 (GMT) (envelope-from sean@mcneil.com) Received: from localhost (localhost.mcneil.com [127.0.0.1]) by mail.mcneil.com (Postfix) with ESMTP id D0130F20CC; Wed, 17 Nov 2004 12:35:56 -0800 (PST) Received: from mail.mcneil.com ([127.0.0.1]) by localhost (server.mcneil.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 13696-07; Wed, 17 Nov 2004 12:35:48 -0800 (PST) Received: from mcneil.com (mcneil.com [24.199.45.54]) by mail.mcneil.com (Postfix) with ESMTP id CFD5DF207C; Wed, 17 Nov 2004 12:35:47 -0800 (PST) From: Sean McNeil To: Dick Davies In-Reply-To: <20041117135058.GB28461@lb.tenfour> References: <419B3DA9.8020202@fer.hr> <20041117135058.GB28461@lb.tenfour> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-xRiI3PtSTGkJadsgLx3i" Date: Wed, 17 Nov 2004 12:35:47 -0800 Message-Id: <1100723747.18003.4.camel@server.mcneil.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 FreeBSD GNOME Team Port X-Virus-Scanned: by amavisd-new at mcneil.com cc: FreeBSD Current Users cc: Ivan Voras Subject: Re: openldap slapd startup delay X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2004 20:35:57 -0000 --=-xRiI3PtSTGkJadsgLx3i Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2004-11-17 at 13:50 +0000, Dick Davies wrote: > * Ivan Voras [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--