Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Nov 2004 13:50:58 +0000
From:      Dick Davies <rasputnik@hellooperator.net>
To:        Ivan Voras <ivoras@fer.hr>
Cc:        FreeBSD Current Users <freebsd-current@freebsd.org>
Subject:   Re: openldap slapd startup delay
Message-ID:  <20041117135058.GB28461@lb.tenfour>
In-Reply-To: <419B3DA9.8020202@fer.hr>
References:  <419B3DA9.8020202@fer.hr>

next in thread | previous in thread | raw e-mail | index | archive | help
* Ivan Voras <ivoras@fer.hr> [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



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