summaryrefslogtreecommitdiffstats
path: root/ctdb/common/ctdb_daemon.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-04-18 11:55:54 +1000
committerAndrew Tridgell <tridge@samba.org>2007-04-18 11:55:54 +1000
commit7a02b09b01363fdf7e12f10eb46f18492823a2a9 (patch)
tree56baf130d0576610d5be1195884860ebc77d1993 /ctdb/common/ctdb_daemon.c
parentaac20642b28ea19003606275cfa2b9902c4b566e (diff)
downloadsamba-7a02b09b01363fdf7e12f10eb46f18492823a2a9.tar.gz
samba-7a02b09b01363fdf7e12f10eb46f18492823a2a9.tar.xz
samba-7a02b09b01363fdf7e12f10eb46f18492823a2a9.zip
started adding a cleaner daemon finish method
(This used to be ctdb commit 5ef0cd83d7f24616dad85cece485b770376ecd45)
Diffstat (limited to 'ctdb/common/ctdb_daemon.c')
-rw-r--r--ctdb/common/ctdb_daemon.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ctdb/common/ctdb_daemon.c b/ctdb/common/ctdb_daemon.c
index a4bb36d482..1e85440efd 100644
--- a/ctdb/common/ctdb_daemon.c
+++ b/ctdb/common/ctdb_daemon.c
@@ -611,3 +611,15 @@ void *ctdbd_allocate_pkt(struct ctdb_context *ctdb, size_t len)
return talloc_size(ctdb, size);
}
+/*
+ called when a CTDB_REQ_FINISHED packet comes in
+*/
+void ctdb_request_finished(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
+{
+ ctdb->num_finished++;
+ if (ctdb->num_finished == ctdb->num_nodes) {
+ /* all daemons have requested to finish - we now exit */
+ DEBUG(1,("All daemons finished - exiting\n"));
+ _exit(0);
+ }
+}