From 97b56f1ec15a3270cc2e85c9b367e4d38f91ae1a Mon Sep 17 00:00:00 2001 From: Victor Tapia Date: Mon, 16 Oct 2017 09:45:24 +0200 Subject: [PATCH 63/79] WATCHDOG: Restart providers with SIGUSR2 after time drift MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restarting the providers using the already implemented SIGUSR2 (for method .resetOffline, used after netlink detects an interface change) when a time drift is detected, ensures that affected connection retries (e.g. LDAP) will be rescheduled immediately instead of having to wait the time shifted to return to its normal execution. Resolves: https://pagure.io/SSSD/sssd/issue/3285 Reviewed-by: Lukáš Slebodník Reviewed-by: Fabiano Fidêncio --- src/util/util_watchdog.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/util_watchdog.c b/src/util/util_watchdog.c index 59293db60e4ffbe566f8b17f3f289503e8d9aee6..20a8b896791118c1ae9b5bfe101a539b213497a4 100644 --- a/src/util/util_watchdog.c +++ b/src/util/util_watchdog.c @@ -160,6 +160,10 @@ static void watchdog_fd_read_handler(struct tevent_context *ev, "[%d]: %s\n", ret, sss_strerror(ret)); orderly_shutdown(1); } + if (strncmp(debug_prg_name, "sssd[be[", sizeof("sssd[be[") - 1) == 0) { + kill(getpid(), SIGUSR2); + DEBUG(SSSDBG_IMPORTANT_INFO, "SIGUSR2 sent to %s\n", debug_prg_name); + } } int setup_watchdog(struct tevent_context *ev, int interval) -- 2.15.1