From 7613c50332469146838cdc524ecee40b3f379322 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 5 Jul 2021 21:09:50 +0200 Subject: lib: Don't initialize process RIB for IPCPs This will skip rib_init() at __init() for IPCPs (or at least, processes that have "ipcpd" in the executable name). The previous code tried to unmount the generic mount and then remount under the ipcp name, but it often failed because fuse_mount() is asynchronous and the mount was not up at the time of the unmount() call. Renaming the mount instead of unmounting failed for the same reason. This is a better fix for now. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/dev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/lib/dev.c') diff --git a/src/lib/dev.c b/src/lib/dev.c index fbbc096d..723e3350 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -443,9 +443,11 @@ static void init(int argc, goto fail_timerwheel; #if defined PROC_FLOW_STATS - sprintf(procstr, "proc.%d", getpid()); - /* Don't bail, it just won't show metrics */ - rib_init(procstr); + if (strstr(argv[0], "ipcpd") == NULL) { + sprintf(procstr, "proc.%d", getpid()); + /* Don't bail on fail, it just won't show metrics */ + rib_init(procstr); + } #endif return; -- cgit v1.2.3