From 552ae84085538597602f63c0dd512e48628a0199 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Thu, 9 May 2024 19:05:21 +0200 Subject: [PATCH] MONITOR: quit if any of providers didn't start This more or less cosmetic change in the sense that currently this code / condition shouldn't be reachable (see comment in the patch). --- src/monitor/monitor.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 3b362876a3a..ebf08446a6e 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -514,17 +514,13 @@ static void services_startup_timeout(struct tevent_context *ev, DEBUG(SSSDBG_TRACE_FUNC, "Handling timeout\n"); if (!ctx->services_started) { - - DEBUG(SSSDBG_CRIT_FAILURE, "Providers did not start in time, " - "forcing services startup!\n"); - - ctx->services_started = true; - - DEBUG(SSSDBG_CONF_SETTINGS, "Now starting services!\n"); - /* then start all services */ - for (i = 0; ctx->services[i]; i++) { - add_new_service(ctx, ctx->services[i], 0); - } + /* This code is more a sanity guard: if any of providers + * didn't start to this moment (MONITOR_MAX_SVC_RESTARTS), + * `monitor_restart_service()` should already have process + * terminated anyway. + */ + DEBUG(SSSDBG_CRIT_FAILURE, "Providers did not start in time!\n"); + monitor_quit(mt_ctx, 1); } }