| |
@@ -2663,6 +2663,20 @@
|
| |
monitor->conf_path, &main_ctx);
|
| |
if (ret != EOK) return 2;
|
| |
|
| |
+ /* Use confd initialized in server_setup. ldb_tdb module (1.4.0) check PID
|
| |
+ * of process which initialized db for locking purposes.
|
| |
+ * Failed to unlock db: ../ldb_tdb/ldb_tdb.c:147:
|
| |
+ * Reusing ldb opened by pid 28889 in process 28893
|
| |
+ */
|
| |
+ talloc_zfree(monitor->cdb);
|
| |
+ monitor->cdb = main_ctx->confdb_ctx;
|
| |
+
|
| |
+ ret = confdb_get_domains(monitor->cdb, &monitor->domains);
|
| |
+ if (ret != EOK) {
|
| |
+ DEBUG(SSSDBG_FATAL_FAILURE, "No domains configured.\n");
|
| |
+ return 4;
|
| |
+ }
|
| |
+
|
| |
monitor->is_daemon = !opt_interactive;
|
| |
monitor->parent_pid = main_ctx->parent_pid;
|
| |
monitor->ev = main_ctx->event_ctx;
|
| |
confdb was initialized twice in monitor. The 1st time in
load_configuration and the 2nd time in server_setup.
libldb-1.4.0 contains stricter checking of PID which created db.
ldb_tdb: Prevent ldb_tdb reuse after a fork()
It did not cause any problem when sssd was stared in interactive mode
(used by systemd) But it cause failures in daemon mode which is used
in cwrap integration
[sssd] [ldb] (0x4000): Destroying timer event 0x5555557b1d30 "ltdb_timeout"
[sssd] [ldb] (0x4000): Ending timer event 0x5555557cbdd0 "ltdb_callback"
[sssd] [server_setup] (0x0400): CONFDB: /var/lib/sss/db/config.ldb
[sssd] [ldb] (0x0010): Failed to unlock db: ../ldb_tdb/ldb_tdb.c:147: Reusing ldb opend by pid 28889 in process 28893
/ Protocol error
[sssd] [confdb_get_param] (0x0020): Failed to get [krb5_rcache_dir] from [config/sssd], error [5] (Input/output error)
[sssd] [confdb_get_string] (0x0020): Failed to get [krb5_rcache_dir] from [config/sssd], error [5] (Input/output error)