summaryrefslogtreecommitdiffstats
path: root/glusterfsd
diff options
context:
space:
mode:
Diffstat (limited to 'glusterfsd')
-rw-r--r--glusterfsd/src/glusterfsd.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
index 61ae4e497fc..ffd1eb48144 100644
--- a/glusterfsd/src/glusterfsd.c
+++ b/glusterfsd/src/glusterfsd.c
@@ -1246,7 +1246,6 @@ cleanup_and_exit (int signum)
glusterfs_pidfile_cleanup (ctx);
- exit (0);
#if 0
/* TODO: Properly do cleanup_and_exit(), with synchronization */
if (ctx->mgmt) {
@@ -1254,19 +1253,27 @@ cleanup_and_exit (int signum)
rpc_clnt_connection_cleanup (&ctx->mgmt->conn);
rpc_clnt_unref (ctx->mgmt);
}
+#endif
/* call fini() of each xlator */
- trav = NULL;
- if (ctx->active)
- trav = ctx->active->top;
- while (trav) {
- if (trav->fini) {
- THIS = trav;
- trav->fini (trav);
+
+ /*call fini for glusterd xlator */
+ /* TODO : Invoke fini for rest of the xlators */
+ if (ctx->process_mode == GF_GLUSTERD_PROCESS) {
+
+ trav = NULL;
+ if (ctx->active)
+ trav = ctx->active->top;
+ while (trav) {
+ if (trav->fini) {
+ THIS = trav;
+ trav->fini (trav);
+ }
+ trav = trav->next;
}
- trav = trav->next;
+
}
-#endif
+ exit(0);
}