MCPcopy Create free account
hub / github.com/ceph/ceph / init

Method init

src/mon/MonClient.cc:494–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492// ----------------------
493
494int MonClient::init()
495{
496 ldout(cct, 10) << __func__ << dendl;
497
498 std::lock_guard l(monc_lock);
499 stopping = false;
500
501 entity_name = cct->_conf->name;
502
503 auth_registry.refresh_config();
504
505 keyring.reset(new KeyRing);
506 if (auth_registry.is_supported_method(messenger->get_mytype(),
507 CEPH_AUTH_CEPHX)) {
508 // this should succeed, because auth_registry just checked!
509 int r = keyring->from_ceph_context(cct);
510 if (r != 0) {
511 // but be somewhat graceful in case there was a race condition
512 lderr(cct) << "keyring not found" << dendl;
513 return r;
514 }
515 }
516 if (!auth_registry.any_supported_methods(messenger->get_mytype())) {
517 return -ENOENT;
518 }
519
520 rotating_secrets.reset(
521 new RotatingKeyRing(cct, cct->get_module_type(), keyring.get()));
522
523 initialized = true;
524
525 messenger->set_auth_client(this);
526 messenger->add_dispatcher_head(this, Dispatcher::PRIORITY_HIGH);
527
528 timer.init();
529 schedule_tick();
530
531 cct->get_admin_socket()->register_command(
532 "rotate-key",
533 this,
534 "rotate live authentication key");
535
536 return 0;
537}
538
539void MonClient::shutdown()
540{

Callers 1

_init_authMethod · 0.45

Calls 12

is_supported_methodMethod · 0.80
from_ceph_contextMethod · 0.80
any_supported_methodsMethod · 0.80
get_module_typeMethod · 0.80
add_dispatcher_headMethod · 0.80
get_admin_socketMethod · 0.80
refresh_configMethod · 0.45
resetMethod · 0.45
get_mytypeMethod · 0.45
getMethod · 0.45
set_auth_clientMethod · 0.45
register_commandMethod · 0.45

Tested by

no test coverage detected