#include "common/ceph_argparse.h"
#include "crimson/common/buffer_io.h"
#include "crimson/common/config_proxy.h"
+#include "crimson/mon/MonClient.h"
#include "crimson/net/Messenger.h"
#include "global/pidfile.h"
}
}
+seastar::future<> fetch_config()
+{
+ // i don't have any client before joining the cluster, so no need to have
+ // a proper auth handler
+ class DummyAuthHandler : public crimson::common::AuthHandler {
+ public:
+ void handle_authentication(const EntityName& name,
+ const AuthCapsInfo& caps)
+ {}
+ };
+ auto auth_handler = std::make_unique<DummyAuthHandler>();
+ auto msgr = crimson::net::Messenger::create(entity_name_t::CLIENT(),
+ "temp_mon_client",
+ get_nonce());
+ auto monc = std::make_unique<crimson::mon::Client>(*msgr, *auth_handler);
+ msgr->set_auth_client(monc.get());
+ return msgr->start({monc.get()}).then([monc=monc.get()] {
+ return monc->start();
+ }).then([monc=monc.get()] {
+ monc->sub_want("config", 0, 0);
+ return monc->renew_subs();
+ }).then([monc=monc.get()] {
+ // wait for monmap and config
+ return monc->wait_for_config();
+ }).then([monc=monc.get()] {
+ return local_conf().set_val("fsid", monc->get_fsid().to_string());
+ }).then([monc=monc.get(), msgr=msgr.get()] {
+ msgr->stop();
+ return monc->stop();
+ }).then([msgr=msgr.get()] {
+ return msgr->shutdown();
+ }).then([msgr=std::move(msgr),
+ auth_handler=std::move(auth_handler),
+ monc=std::move(monc)]
+ {});
+}
+
int main(int argc, char* argv[])
{
seastar::app_template app;
seastar::engine().exit(1);
}).get();
}
+ fetch_config().get();
if (config.count("mkfs")) {
osd.invoke_on(
0,