#3751 MONITOR: Do not use two configuration databases
Closed 5 years ago by fidencio. Opened 5 years ago by lslebodn.
SSSD/ lslebodn/sssd ldb_1.4  into  master

file modified
+14
@@ -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()

We may relax this restriction in the future, but for now do not assume
that the caller has done a tdb_reopen_all() at the right time.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>

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)

rebased onto d74a754

5 years ago

Patch looks good and I've fired an internal CI build.

I'll get back to it as soon as I have the results and push the patch.

Pull-Request has been closed by fidencio

5 years ago

master:
a887e33

BTW The original patch https://pagure.io/SSSD/sssd/pull-request/3751.patch contained a little bit more in commit message. May I know why some parts were removed?

It is not very polite to modify it without asking for permissions from the author.

Lukáš,

Sorry if I ended up removing something by mistake while merging your patch. It was not intentional, at all.

I appreciated that you've brought it to my attention and I'll double-check next time I'm accepting some patch. Thanks a lot for both your contribution and your comment.

Metadata