[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: openldap service stop cause database corruption



On Thursday, 8 October 2009 14:07:34 Antonini Gabriele wrote:
> > I don't know about CentOS, but if it's anything like Redhat, the
> > system provided init scripts are very hostile to processes that don't
> > shut down fast enough.
> >
> > The killproc() function will send a TERM, wait 100k microseconds, then
> > send a KILL.
> >
> > You're running a large process on a low-memory machine.  I strongly
> > suspect CentOS isn't giving slapd enough time to shut down properly.
> >
> > Instead of using the system scripts, try sending a plain kill to slapd
> > and timing how long it takes to shut down.  If it's more than 100
> > seconds, you'll either need to add memory (I'd recommend that anyway)
> > or stop using the CentOS init scripts to start and stop OpenLDAP.
>
> I tried modifying stop script adding 30 seconds sleep after killproc but
> the problem remains. Here is the stop script:
>
> function stop() {
>         # Stop daemons.
>         prog=`basename ${slapd}`
>         echo -n $"Stopping $prog: "
>         killproc ${slapd}

Make this:

killproc -d 30 ${slapd}

(and remove the line below)

>         sleep 30
>         RETVAL=$?
>         echo
>         if [ $RETVAL -eq 0 ]; then
>             if grep -q "^replogfile" /etc/openldap/slapd.conf; then
>                 prog=`basename ${slurpd}`
>                 echo -n $"Stopping $prog: "
>                 killproc ${slurpd}
>                 sleep 30
>                 RETVAL=$?
>                 echo
>             fi
>         fi
>         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ldap
> /var/run/slapd.args return $RETVAL
> }