Run the shutdown eventscript before we tear down the transport
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 30 May 2012 01:50:13 +0000 (11:50 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 30 May 2012 01:50:13 +0000 (11:50 +1000)
This allows eventscripts to still be able to call and use ctdb during the shutdown phase.

server/ctdb_control.c

index 2a16a23ad80ed693c71a799bdbf17f6004385f66..326887753b2e73e1ca09415f17cadaa95c72012c 100644 (file)
@@ -323,10 +323,10 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
                ctdb_stop_keepalive(ctdb);
                ctdb_stop_monitoring(ctdb);
                ctdb_release_all_ips(ctdb);
+               ctdb_event_script(ctdb, CTDB_EVENT_SHUTDOWN);
                if (ctdb->methods != NULL) {
                        ctdb->methods->shutdown(ctdb);
                }
-               ctdb_event_script(ctdb, CTDB_EVENT_SHUTDOWN);
                exit(0);
 
        case CTDB_CONTROL_TAKEOVER_IPv4: