From 287acba9b1b7d91811d8e8a22ed5e7824e8a26b3 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Mon, 7 Nov 2016 11:58:20 +0100 Subject: [PATCH 21/39] MONITOR: Do not set up watchdog for monitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It makes little sense to set up watchdog for monitor because there is no entity that would restart the monitor. Therefore we should disable the watchdog for monitor process. Resolves: https://fedorahosted.org/sssd/ticket/3232 Reviewed-by: Lukáš Slebodník (cherry picked from commit fbe6644aa28d93f492434950680c5618eb567712) (cherry picked from commit 2d88a121918e800b266d018d43dad9bd374b10a7) --- src/monitor/monitor.c | 2 ++ src/util/server.c | 11 +++++++---- src/util/util.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 84a144e56..935febb95 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -2603,6 +2603,8 @@ int main(int argc, const char *argv[]) /* we want a pid file check */ flags |= FLAGS_PID_FILE; + /* the monitor should not run a watchdog on itself */ + flags |= FLAGS_NO_WATCHDOG; /* Open before server_setup() does to have logging * during configuration checking */ diff --git a/src/util/server.c b/src/util/server.c index 953cd3d61..013e572e6 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -666,10 +666,13 @@ int server_setup(const char *name, int flags, ret, strerror(ret)); return ret; } - ret = setup_watchdog(ctx->event_ctx, watchdog_interval); - if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, "Watchdog setup failed.\n"); - return ret; + + if ((flags & FLAGS_NO_WATCHDOG) == 0) { + ret = setup_watchdog(ctx->event_ctx, watchdog_interval); + if (ret != EOK) { + DEBUG(SSSDBG_CRIT_FAILURE, "Watchdog setup failed.\n"); + return ret; + } } sss_log(SSS_LOG_INFO, "Starting up"); diff --git a/src/util/util.h b/src/util/util.h index 9c39a5cc5..4bfccfa2b 100644 --- a/src/util/util.h +++ b/src/util/util.h @@ -88,6 +88,7 @@ #define FLAGS_INTERACTIVE 0x0002 #define FLAGS_PID_FILE 0x0004 #define FLAGS_GEN_CONF 0x0008 +#define FLAGS_NO_WATCHDOG 0x0010 #define PIPE_INIT { -1, -1 } -- 2.11.0