summaryrefslogtreecommitdiff
path: root/server/monitor
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-03-27 07:26:27 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-03-27 07:38:28 -0400
commit403c91f8fc9023a80bd009af493b3bc937564700 (patch)
tree4c219b8122410c11f18c985803ae0cc2c4ae58ff /server/monitor
parent0793b52b7860c90f8bd134a4c080d4bea0b7c9dc (diff)
downloadsssd-403c91f8fc9023a80bd009af493b3bc937564700.tar.gz
sssd-403c91f8fc9023a80bd009af493b3bc937564700.tar.bz2
sssd-403c91f8fc9023a80bd009af493b3bc937564700.zip
Fix bug where services restarted by the monitor would be pinged more than once per cycle
Diffstat (limited to 'server/monitor')
-rw-r--r--server/monitor/monitor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 0ee344cb..9320ed82 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -64,6 +64,8 @@ struct mt_svc {
time_t last_pong;
int debug_level;
+
+ struct tevent_timer *ping_ev;
};
struct mt_ctx {
@@ -192,6 +194,11 @@ static void svc_try_restart(struct mt_svc *svc, time_t now)
return;
}
+ /* Shut down the current ping timer so it will restart
+ * cleanly in start_service()
+ */
+ talloc_free(svc->ping_ev);
+
ret = start_service(svc);
if (ret != EOK) {
DEBUG(0,("Failed to restart service '%s'\n", svc->name));
@@ -286,6 +293,7 @@ static void set_tasks_checker(struct mt_svc *svc)
svc->name));
/* FIXME: shutdown ? */
}
+ svc->ping_ev = te;
}
static void global_checks_handler(struct tevent_context *ev,