Revert "ctdb-daemon: Remove unused function ctdb_stop_monitoring()"
authorMartin Schwenke <martin@meltin.net>
Mon, 18 Sep 2017 06:36:08 +0000 (16:36 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 18 Sep 2017 23:28:13 +0000 (01:28 +0200)
This reverts commit b119104267635d96b1f99a2e98d35438841585bf.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/include/ctdb_private.h
ctdb/server/ctdb_monitor.c

index b38e225c470ae79e12d7d14992962f864f95884f..9be81ff8603740f2e0952c173cb689852715bf6e 100644 (file)
@@ -747,6 +747,8 @@ int32_t ctdb_control_get_db_statistics(struct ctdb_context *ctdb,
 int ctdb_set_notification_script(struct ctdb_context *ctdb, const char *script);
 void ctdb_run_notification_script(struct ctdb_context *ctdb, const char *event);
 
+void ctdb_stop_monitoring(struct ctdb_context *ctdb);
+
 void ctdb_wait_for_first_recovery(struct ctdb_context *ctdb);
 
 int32_t ctdb_control_modflags(struct ctdb_context *ctdb, TDB_DATA indata);
index 1455d82bf76ae8d84ce67a85e4a8fc608216704b..2ecbbb393c02d8dcbb776180953eef24760b083c 100644 (file)
@@ -415,6 +415,18 @@ static void ctdb_check_health(struct tevent_context *ev,
        }
 }
 
+/* stop any monitoring 
+   this should only be done when shutting down the daemon
+*/
+void ctdb_stop_monitoring(struct ctdb_context *ctdb)
+{
+       talloc_free(ctdb->monitor->monitor_context);
+       ctdb->monitor->monitor_context = NULL;
+
+       ctdb->monitor->next_interval = 5;
+       DEBUG(DEBUG_NOTICE,("Monitoring has been stopped\n"));
+}
+
 /*
   start watching for nodes that might be dead
  */