]> git.puffer.fish Git - mirror/frr.git/commit
lib: postpone the sysrepo plugin initialization
authorRenato Westphal <renato@opensourcerouting.org>
Sat, 12 Sep 2020 01:39:11 +0000 (22:39 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Tue, 15 Sep 2020 18:55:55 +0000 (15:55 -0300)
commit88e635ee6397b93a3263dbe7951f637ae4936e39
treeac4a679987a82b78eaa743c77fbf919597324b78
parenteac139f8f26315076d2c5fd94e7ac2fe322be084
lib: postpone the sysrepo plugin initialization

From Sysrepo's documentation:
"Note: do not use fork() after creating a connection. Sysrepo
internally stores PID of every created connection and this way a
mismatch of PID and connection is created".

Introduce a new "frr_very_late_init" hook in libfrr that is only
called after the daemon is forked (when the '-d' option is used)
and after the configuration is read. This way we can initialize
the sysrepo plugin correctly even when the daemon is daemonized,
and after the Sysrepo CLI commands are processed (only "debug
northbound client sysrepo" for now).

Fixes #7062

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
lib/libfrr.c
lib/libfrr.h
lib/northbound_sysrepo.c