MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / main

Function main

tools/attrd.c:528–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528int
529main(int argc, char **argv)
530{
531 int flag = 0;
532 int argerr = 0;
533 crm_cluster_t cluster;
534 gboolean was_err = FALSE;
535 qb_ipcs_connection_t *c = NULL;
536 qb_ipcs_service_t *ipcs = NULL;
537
538 crm_log_init(T_ATTRD, LOG_NOTICE, TRUE, FALSE, argc, argv, FALSE);
539 mainloop_add_signal(SIGTERM, attrd_shutdown);
540
541 while ((flag = getopt(argc, argv, OPTARGS)) != EOF) {
542 switch (flag) {
543 case 'V':
544 crm_bump_log_level(argc, argv);
545 break;
546 case 'h': /* Help message */
547 usage(T_ATTRD, EX_OK);
548 break;
549 default:
550 ++argerr;
551 break;
552 }
553 }
554
555 if (optind > argc) {
556 ++argerr;
557 }
558
559 if (argerr) {
560 usage(T_ATTRD, EX_USAGE);
561 }
562
563 attr_hash = g_hash_table_new_full(crm_str_hash, g_str_equal, NULL, free_hash_entry);
564
565 crm_info("Starting up");
566
567 if (was_err == FALSE) {
568
569#if SUPPORT_COROSYNC
570 if (is_openais_cluster()) {
571 cluster.destroy = attrd_ais_destroy;
572 cluster.cs_dispatch = attrd_ais_dispatch;
573 }
574#endif
575
576#if SUPPORT_HEARTBEAT
577 if (is_heartbeat_cluster()) {
578 cluster.hb_conn = NULL;
579 cluster.hb_dispatch = attrd_ha_callback;
580 cluster.destroy = attrd_ha_connection_destroy;
581 }
582#endif
583
584 if (FALSE == crm_cluster_connect(&cluster)) {
585 crm_err("HA Signon failed");

Callers

nothing calls this directly

Calls 12

crm_log_initFunction · 0.85
mainloop_add_signalFunction · 0.85
crm_bump_log_levelFunction · 0.85
is_openais_clusterFunction · 0.85
is_heartbeat_clusterFunction · 0.85
crm_cluster_connectFunction · 0.85
mainloop_add_ipc_serverFunction · 0.85
crm_exitFunction · 0.85
crm_ipcs_client_pidFunction · 0.85
cib_deleteFunction · 0.85
empty_uuid_cacheFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected