election_trigger->source_id = -1; election_trigger->period_ms = -1; election_trigger->fsa_input = I_DC_TIMEOUT; election_trigger->callback = timer_popped;  dc_heartbeat->source_id = -1; dc_heartbeat->period_ms = -1; dc_heartbeat->fsa_input = I_NULL; dc_heartbeat->callback = do_dc_heartbeat;  election_timeout->source_id = -1; election_timeout->period_ms = -1; election_timeout->fsa_input = I_ELECTION_DC; election_timeout->callback = timer_popped;  integration_timer->source_id = -1; integration_timer->period_ms = -1; integration_timer->fsa_input = I_INTEGRATION_TIMEOUT; integration_timer->callback = timer_popped;
if(dc_heartbeat != NULL) { dc_heartbeat->source_id = -1; dc_heartbeat->period_ms = -1; dc_heartbeat->fsa_input = I_NULL; dc_heartbeat->callback = do_dc_heartbeat; } else { was_error = TRUE; }
do_startup(long long action,	   enum crmd_fsa_cause cause,	   enum crmd_fsa_state cur_state,	   enum crmd_fsa_input current_input,	   void *data){	int facility;	int was_error = 0;	int interval = 1; /* seconds between DC heartbeats */	fsa_input_register = 0; /* zero out the regester */		crm_info("Register PID");	register_pid(PID_FILE, FALSE, crm_shutdown);		ipc_clients = g_hash_table_new(&g_str_hash, &g_str_equal);		/* change the logging facility to the one used by heartbeat daemon */	fsa_cluster_conn = ll_cluster_new("heartbeat");		crm_info("Switching to Heartbeat logger");	if ((facility =	     fsa_cluster_conn->llc_ops->get_logfacility(		     fsa_cluster_conn)) > 0) {		cl_log_set_facility(facility);	}		crm_verbose("Facility: %d", facility);		if(was_error == 0) {		crm_info("Init server comms");		was_error = init_server_ipc_comms(			CRM_SYSTEM_CRMD, crmd_client_connect,			default_ipc_input_destroy);	}		/* set up the timers */	dc_heartbeat     = (fsa_timer_t *)crm_malloc(sizeof(fsa_timer_t));	integration_timer= (fsa_timer_t *)crm_malloc(sizeof(fsa_timer_t));	election_trigger = (fsa_timer_t *)crm_malloc(sizeof(fsa_timer_t));	election_timeout = (fsa_timer_t *)crm_malloc(sizeof(fsa_timer_t));	shutdown_escalation_timmer = (fsa_timer_t *)		crm_malloc(sizeof(fsa_timer_t));	interval = interval * 1000;		election_trigger->source_id = -1;	election_trigger->period_ms = -1;	election_trigger->fsa_input = I_DC_TIMEOUT;	election_trigger->callback = timer_popped;	dc_heartbeat->source_id = -1;	dc_heartbeat->period_ms = -1;	dc_heartbeat->fsa_input = I_NULL;	dc_heartbeat->callback = do_dc_heartbeat;			election_timeout->source_id = -1;	election_timeout->period_ms = -1;	election_timeout->fsa_input = I_ELECTION_DC;	election_timeout->callback = timer_popped;	integration_timer->source_id = -1;	integration_timer->period_ms = -1;	integration_timer->fsa_input = I_INTEGRATION_TIMEOUT;	integration_timer->callback = timer_popped;		shutdown_escalation_timmer->source_id = -1;	shutdown_escalation_timmer->period_ms = -1;	shutdown_escalation_timmer->fsa_input = I_TERMINATE;	shutdown_escalation_timmer->callback = timer_popped;		/* set up the sub systems */	cib_subsystem = (struct crm_subsystem_s*)		crm_malloc(sizeof(struct crm_subsystem_s));		cib_subsystem->pid = 0;		cib_subsystem->respawn = 1;		cib_subsystem->path = crm_strdup(BIN_DIR);	cib_subsystem->name = crm_strdup(CRM_SYSTEM_CIB);	cib_subsystem->command = BIN_DIR"/cib";	cib_subsystem->flag = R_CIB_CONNECTED;		te_subsystem = (struct crm_subsystem_s*)		crm_malloc(sizeof(struct crm_subsystem_s));		te_subsystem->pid = 0;		te_subsystem->respawn = 1;		te_subsystem->path = crm_strdup(BIN_DIR);	te_subsystem->name = crm_strdup(CRM_SYSTEM_TENGINE);	te_subsystem->command = BIN_DIR"/tengine";	te_subsystem->flag = R_TE_CONNECTED;		pe_subsystem = (struct crm_subsystem_s*)		crm_malloc(sizeof(struct crm_subsystem_s));		pe_subsystem->pid = 0;		pe_subsystem->respawn = 1;		pe_subsystem->path = crm_strdup(BIN_DIR);	pe_subsystem->name = crm_strdup(CRM_SYSTEM_PENGINE);	pe_subsystem->command = BIN_DIR"/pengine";	pe_subsystem->flag = R_PE_CONNECTED;		if(was_error)		return I_FAIL;		return I_NULL;}