]> 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)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 6 Oct 2020 12:54:24 +0000 (15:54 +0300)
commit5ea403a6dd414e418c1efcad70db165426f0642c
treedeb88c40acfac69d1cd2fa009d31e78298e542ed
parentdbced16a98ad39d289af388416f05fca2320677d
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