I installed the Security Update 2019-003 this morning. The update went awry, and produced on (postgres) induced panic on the host, a second attempt succeeded. After the update, slapd will not launch anymore.
I've tried restoring /private/var/db/{krb5kdc,openldap,auth} from a Time Machine backup (through Cmd-R reboot, including temporarily turning SIP off) but whatever I do, I can't get it running again. db_recover won't help either. slapd testing produces:
bash-3.2# /usr/libexec/slapd -T test
5cdfeed8 bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
5cdfeed8 bdb_db_open: database "cn=authdata": unclean shutdown detected; attempting recovery.
5cdfeed8 bdb_db_open: database "cn=authdata": recovery skipped in read-only mode. Run manual recovery if errors are encountered.
config file testing succeeded
bash-3.2# slaptest -v
5cdfef28 bdb_monitor_db_open: monitoring disabled; configure monitor database to enable
5cdfef28 bdb_db_open: database "cn=authdata": unclean shutdown detected; attempting recovery.
5cdfef28 bdb_db_open: database "cn=authdata": recovery skipped in read-only mode. Run manual recovery if errors are encountered.
config file testing succeeded
How can I recover this from my Time Machine backup without completely restoring the server and overwriting everything else?
Apparently the restore I tried (copy openldap over from a Time Machine backup) did not work as Postgres DB-recovery balks at what is in authdata:
bash-3.2# db_recover -cv -h authdata/
Finding last valid log LSN: file: 31 offset 174121
Recovery starting from [30][28]
db_recover: Log sequence error: page LSN 23 1709981; previous LSN 30 28
db_recover: Recovery function for LSN 30 8130 failed on forward pass
db_recover: PANIC: Invalid argument
db_recover: process-private: unable to find environment
db_recover: DB_ENV->open: DB_RUNRECOVERY: Fatal error, run database recovery
bash-3.2# db_recover -cv -h openldap-data/
Finding last valid log LSN: file: 1 offset 1754044
Recovery starting from [1][28]
Recovery complete at Sat May 18 13:45:46 2019
Maximum transaction ID 80000cad Recovery checkpoint [1][1754044]