Mailing List
Home
Forum Home
Linux - General Red Hat Linux discussion list
Installation - Getting started with Red Hat Linux
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
OpenLDAP init Script

OpenLDAP init Script

2007-05-23       - By Joshua Gimer

 Back
I just wanted to point out what I would consider an implementation flaw in
RH Version of OpenLDAP. It is both the same on RHEL4 and 5. In the LDAP init
script provided by Red Hat (/etc/init.d/ldap) there is a problem with how
the stop function shuts down running LDAP Directories. I have actually
already have had database corruption on two systems because of this.
Killproc is called without a signal, it defaults to -TERM and then -KILL.
You can see this here:

Taken from killproc() in /etc/init.d/functions:

       if [ -n "${pid:-}" ] ; then
               [ "$BOOTUP" = "verbose" -a -z "$LSB" ] && echo -n "$base "
               if [ "$notset" -eq "1" ] ; then
                      if checkpid $pid 2>&1; then
                          # TERM first, then KILL if not dead
                          kill -TERM $pid >/dev/null 2>&1
                          usleep 100000
                          if checkpid $pid && sleep 1 &&
                             checkpid $pid && sleep $delay &&
                             checkpid $pid ; then
                               kill -KILL $pid >/dev/null 2>&1
                               usleep 100000
                          fi
                       fi
                       checkpid $pid
                       RC=$?
                       [ "$RC" -eq 0 ] && failure $"$base shutdown" ||
success $"$base shutdown"
                       RC=$((! $RC))
               # use specified level only
               else
                       if checkpid $pid; then
                               kill $killlevel $pid >/dev/null 2>&1
                               RC=$?
                               [ "$RC" -eq 0 ] && success $"$base
$killlevel" || failure $"$base $killlevel"
                       fi
               fi
       else
           failure $"$base shutdown"
           RC=1
       fi

/etc/init.d/ldap stop function

function stop() {
       # Stop daemons.
       prog=`basename ${slapd}`
       echo -n $"Stopping $prog: "
       killproc ${slapd}
       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}
               RETVAL=$?
               echo
           fi
       fi
       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ldap /var/run/slapd.args
       return $RETVAL
}

I am making the suggestion that Red hat change the default init script that
is distributes with OpenLDAP to stop the directories with -INT. Like below:

function stop() {
       # Stop daemons.
       prog=`basename ${slapd}`
       echo -n $"Stopping $prog: "
       killproc ${slapd}
       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} -INT
               RETVAL=$?
               echo
           fi
       fi
       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ldap /var/run/slapd.args
       return $RETVAL
}

This will get rid of the issue of database corruption, when using
/etc/init.d/ldap.

If there is anyone else out there that has had similar problems, please
speak up. You can fix this by changing to your database directory and
running slapd_db_recover.

--
Thx
Joshua Gimer
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list