From owner-freebsd-current@FreeBSD.ORG Wed Nov 17 13:51:00 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 66B2A16A4CE for ; Wed, 17 Nov 2004 13:51:00 +0000 (GMT) Received: from 9.hellooperator.net (cpc3-cdif2-3-0-cust202.cdif.cable.ntl.com [81.103.32.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 034D043D1F for ; Wed, 17 Nov 2004 13:51:00 +0000 (GMT) (envelope-from rasputin@hellooperator.net) Received: from rasputin by 9.hellooperator.net with local (Exim 4.43) id 1CUQD4-0007kO-U5; Wed, 17 Nov 2004 13:50:58 +0000 Date: Wed, 17 Nov 2004 13:50:58 +0000 From: Dick Davies To: Ivan Voras Message-ID: <20041117135058.GB28461@lb.tenfour> References: <419B3DA9.8020202@fer.hr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <419B3DA9.8020202@fer.hr> User-Agent: Mutt/1.4.2.1i Sender: Rasputin cc: FreeBSD Current Users Subject: Re: openldap slapd startup delay X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dick Davies 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 13:51:00 -0000 * Ivan Voras [1124 13:24]: > I'm running pam_ldap & nss_ldap fine, but there's a huge delay when > slapd starts (upto 30sec.). During the delay there's no load on the > machine, and it's listening on hosts that are name-resolvable via > /etc/hosts (it has priority in /etc/nsswitch.conf). 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. I replaced it with this, which starts instantly : root@eris exim # less /usr/local/etc/rc.d/000._slappy.sh #!/bin/sh # please don't mistake me for someone who gives a shit that I check a pidfile # twice in the stop function, I am too old and lazy to learn shell. DAEMON="/usr/local/libexec/slapd" PIDFILE="/var/run/openldap/slapd.pid" CFG="/usr/local/etc/openldap/slapd.conf" FLAGS='-h ldaps://ldap.domain/ ldap://ldap.domain -u ldap -g ldap' case $1 in start) [ -x ${DAEMON} ] && { echo -n ' starting slapd' ${DAEMON} ${FLAGS} } ;; stop) [ -f ${PIDFILE} ] || ( echo ' slapd not running? (no ${PIDFILE})' && exit ) [ -f ${PIDFILE} ] && { echo -n ' stopping slapd' kill `cat ${PIDFILE}` } ;; restart) stop start ;; *) echo "usage: `basename $0` {start|stop|restart}" >&2 exit 64 ;; esac -- And if you think you're going to bleed all over me you're even wronger than you normally be - The Specials, 'Little Bitch' Rasputin :: Jack of All Trades - Master of Nuns