void kick_node_from_cluster(int nodeid) { if (!nodeid) { log_error("telling corosync to shut down cluster locally"); corosync_cfg_try_shutdown(ch, COROSYNC_CFG_SHUTDOWN_FLAG_IMMEDIATE); } else { log_error("telling corosync to remove nodeid %d from cluster", nodeid); corosync_cfg_kill_node(ch, nodeid, "dlm_controld"); } }
static void killnode_do(unsigned int nodeid) { cs_error_t result; corosync_cfg_handle_t handle; printf ("Killing node %d\n", nodeid); result = corosync_cfg_initialize (&handle, NULL); if (result != CS_OK) { printf ("Could not initialize corosync configuration API error %d\n", result); exit (1); } result = corosync_cfg_kill_node (handle, nodeid, "Killed by corosync-cfgtool"); if (result != CS_OK) { printf ("Could not kill node (error = %d)\n", result); } (void)corosync_cfg_finalize (handle); }