Re: openldap slapd startup delay

From: Dick Davies <rasputnik_at_hellooperator.net>
Date: Wed, 17 Nov 2004 13:50:58 +0000
* Ivan Voras <ivoras_at_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_at_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
Received on Wed Nov 17 2004 - 12:51:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:22 UTC