A_STARTUP */
| 345 | |
| 346 | /* A_STARTUP */ |
| 347 | void |
| 348 | do_startup(long long action, |
| 349 | enum crmd_fsa_cause cause, |
| 350 | enum crmd_fsa_state cur_state, enum crmd_fsa_input current_input, fsa_data_t * msg_data) |
| 351 | { |
| 352 | int was_error = 0; |
| 353 | int interval = 1; /* seconds between DC heartbeats */ |
| 354 | |
| 355 | crm_debug("Registering Signal Handlers"); |
| 356 | mainloop_add_signal(SIGTERM, crm_shutdown); |
| 357 | |
| 358 | fsa_source = mainloop_add_trigger(G_PRIORITY_HIGH, crm_fsa_trigger, NULL); |
| 359 | config_read = mainloop_add_trigger(G_PRIORITY_HIGH, crm_read_options, NULL); |
| 360 | |
| 361 | ipc_clients = g_hash_table_new(crm_str_hash, g_str_equal); |
| 362 | |
| 363 | crm_debug("Creating CIB and LRM objects"); |
| 364 | fsa_cib_conn = cib_new(); |
| 365 | fsa_lrm_conn = lrmd_api_new(); |
| 366 | |
| 367 | /* set up the timers */ |
| 368 | transition_timer = calloc(1, sizeof(fsa_timer_t)); |
| 369 | integration_timer = calloc(1, sizeof(fsa_timer_t)); |
| 370 | finalization_timer = calloc(1, sizeof(fsa_timer_t)); |
| 371 | election_trigger = calloc(1, sizeof(fsa_timer_t)); |
| 372 | election_timeout = calloc(1, sizeof(fsa_timer_t)); |
| 373 | shutdown_escalation_timer = calloc(1, sizeof(fsa_timer_t)); |
| 374 | wait_timer = calloc(1, sizeof(fsa_timer_t)); |
| 375 | recheck_timer = calloc(1, sizeof(fsa_timer_t)); |
| 376 | |
| 377 | interval = interval * 1000; |
| 378 | |
| 379 | if (election_trigger != NULL) { |
| 380 | election_trigger->source_id = 0; |
| 381 | election_trigger->period_ms = -1; |
| 382 | election_trigger->fsa_input = I_DC_TIMEOUT; |
| 383 | election_trigger->callback = crm_timer_popped; |
| 384 | election_trigger->repeat = FALSE; |
| 385 | } else { |
| 386 | was_error = TRUE; |
| 387 | } |
| 388 | |
| 389 | if (election_timeout != NULL) { |
| 390 | election_timeout->source_id = 0; |
| 391 | election_timeout->period_ms = -1; |
| 392 | election_timeout->fsa_input = I_ELECTION_DC; |
| 393 | election_timeout->callback = crm_timer_popped; |
| 394 | election_timeout->repeat = FALSE; |
| 395 | } else { |
| 396 | was_error = TRUE; |
| 397 | } |
| 398 | |
| 399 | if (transition_timer != NULL) { |
| 400 | transition_timer->source_id = 0; |
| 401 | transition_timer->period_ms = -1; |
| 402 | transition_timer->fsa_input = I_PE_CALC; |
| 403 | transition_timer->callback = crm_timer_popped; |
| 404 | transition_timer->repeat = FALSE; |
nothing calls this directly
no test coverage detected