diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2024-01-25 22:54:54 +0100 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2024-03-10 12:42:14 +0100 |
commit | 95a737ed1bf7f89cb8e5367ef8e8e66a800084d7 (patch) | |
tree | 9c637ac3cc463ed198f6dbd81578bbb90bb57d07 /ldpd/ldpe.c | |
parent | lib: allow recirculating/relaying log messages (diff) | |
download | frr-95a737ed1bf7f89cb8e5367ef8e8e66a800084d7.tar.xz frr-95a737ed1bf7f89cb8e5367ef8e8e66a800084d7.zip |
ldpd: use zlog recirculation for subprocesses
This way, full functionality of `zlog_*` is available.
Having `fatal()` be wrappers around `assertf()` also means we get
backtraces, which is not the case for a plain `exit(1)`.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'ldpd/ldpe.c')
-rw-r--r-- | ldpd/ldpe.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ldpd/ldpe.c b/ldpd/ldpe.c index e66b9e92d..6e844c0aa 100644 --- a/ldpd/ldpe.c +++ b/ldpd/ldpe.c @@ -23,6 +23,7 @@ #include "privs.h" #include "sigevent.h" #include "libfrr.h" +#include "zlog_live.h" static void ldpe_shutdown(void); static void ldpe_dispatch_main(struct event *thread); @@ -93,6 +94,8 @@ char *pkt_ptr; /* packet buffer */ void ldpe(void) { + static struct zlog_live_cfg child_log; + #ifdef HAVE_SETPROCTITLE setproctitle("ldp engine"); #endif @@ -100,6 +103,8 @@ ldpe(void) log_procname = log_procnames[ldpd_process]; master = frr_init(); + zlog_live_open_fd(&child_log, LOG_DEBUG, LDPD_FD_LOG); + /* no frr_config_fork() here, allow frr_pthread to create threads */ frr_is_after_fork = true; |