Re: LDAP server gone -> impossible to login locally!



Olivier Nicole schrieb:
On a related note, why is slapd so damn fragile? It's a righteous pain
in the bum the way you have to run db_recover-X.Y /var/db/openldap-data
if slapd fails to start.
Yes, this is a lot of pain. I have had issues the same way and never
figured out what the reason was. /var/ is very often corrupted after a
crash, power failure or unclean reboot. Maybe not slpad is that fragile,
but db47 is.

Last June, we had to shutdown our openldap server every night, I
noticed that a simple halt(8) would leave the bdb backend database in
a corrupted state.

It worked well if I /usr/local/etc/rc.d/slapd stop and sync(8) a couple
of type before I halt(8).

After that I wrote a small script that would take a backup of the ldap
data every 2 hours and keep 5 days of backup.

It seems that Berkeley DB has a lot of options that need to be
configured to be working optimally with openldap. Maybe soft-update
should be desactivated from the filesystem where the db files reside.

This hasn't anything to do with the filesystem, but with abuse of the
application (read: LDAP daemons) and/or its Berkeley DB support.

If you kill the application before it can write all that it needs to write, you
may corrupt your database, particularly if you catch it in the middle of a page
split if a page in the DB file overflows and your database isn't transactional
(i. e. with log.* files - which requires application support in turn).

I'm not sure about OpenLDAP, but I feel I know Berkeley DB good enough to know
it does not usually create or rename files on shutdown EXCEPT if there are bulk
writes pending in a transactional database (which might then trigger creation of
log.* files or flushing of corresponding writes).

So I'd be surprised if SOFTDEPs were a cause of db47 corruption here.

SOFTDEPs may have side effects that influence the shutdown process as a whole,
but then the shutdown process is broken already without softdeps.

So I'd rather make sure that the daemons are shut down properly at shutdown
time, i. e. run the stop scripts and make sure they sleep long enough for the
application to shut down cleanly (as needed). The database should be properly
closed before halt(8) draws the SIGKILL shotgun and starts firing.

IOW, check that your slapd stop is properly hooked to the shutdown procedure and
waits long enough.

If your filesystems get corrupted at power failures, make sure your HDD write
caches are turned off (unless they're battery backed or otherwise permanent
caches that survive the outage); you'd also need to check if your hardware is
allowed to reorder writes, and if so, if writes get reordered across flush-cache
primitives (aka. write barriers). I'm unaware of current support for preventing
dangerous reorders with enabled write caches in the disk/controller drivers and
filesystems though.
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Exchange 2003 Ops...
    ... Then went and shut down the exchange information store and all ... database was not shutdown cleanly ... MicrosoftExchange Server Database Utilities ...
    (microsoft.public.exchange.admin)
  • Re: Restore of DB Backup gave some errors
    ... With many messages I would recommend checking the entire database using: ... A column nullability inconsistency was detected in the ... The index may be corrupt. ... Run DBCC CHECKTABLE to verify consistency. ...
    (microsoft.public.sqlserver.programming)
  • Re: Form does no longer bind to table
    ... The symptoms you describe indicate that the form has become corrupt, ... Then compact the database to get completely rid of this stuff. ... > I'm only using VBA code and no macros. ... > The form does not bind without filter either. ...
    (microsoft.public.access.forms)
  • Re: There isnt enough memory? -- cannot open form
    ... When you tried the SaveAsText where were you? ... Try this - close the database then reopen it and open the VB Editor. ... > I've now tried "decompile" with no success. ... >> and keep a backup of the corrupt database. ...
    (microsoft.public.access.forms)
  • Re: Cant save form as..error msg
    ... It's a common way to recover a corrupt form or database to copy the code out ... compile it empty and then paste it back in and re-compile. ... Of course it could be that the database is corrupt or mis-compiled. ...
    (microsoft.public.access.forms)