// manually. If they have, update them.
if (g_ceph_context->get_init_flags() != flags) {
g_ceph_context->set_init_flags(flags);
+ if (flags & (CINIT_FLAG_NO_DEFAULT_CONFIG_FILE|
+ CINIT_FLAG_NO_MON_CONFIG)) {
+ g_conf()->no_mon_config = true;
+ }
}
#ifndef _WIN32
#include "include/str_list.h"
#include "include/stringify.h"
-#include "global/global_init.h"
#include "global/signal_handler.h"
#include "common/config.h"
#include "common/errno.h"
{ "log_file", "/var/log/radosgw/$cluster-$name.log" }
};
- cct = global_init(&defaults, args,
- CEPH_ENTITY_TYPE_CLIENT,
- CODE_ENVIRONMENT_DAEMON,
- CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS);
+ cct = rgw_global_init(&defaults, args,
+ CEPH_ENTITY_TYPE_CLIENT,
+ CODE_ENVIRONMENT_DAEMON,
+ CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS);
ceph::mutex mutex = ceph::make_mutex("main");
SafeTimer init_timer(g_ceph_context, mutex);
#include "rgw_arn.h"
#include "rgw_data_sync.h"
+#include "global/global_init.h"
#include "common/ceph_crypto.h"
#include "common/armor.h"
#include "common/errno.h"
return 0;
}
+
+boost::intrusive_ptr<CephContext>
+rgw_global_init(const std::map<std::string,std::string> *defaults,
+ std::vector < const char* >& args,
+ uint32_t module_type, code_environment_t code_env,
+ int flags)
+{
+ // Load the config from the files, but not the mon
+ global_pre_init(defaults, args, module_type, code_env, flags);
+
+ // Get the store backend
+ const auto& config_store = g_conf().get_val<std::string>("rgw_backend_store");
+
+ cerr << "config_store: " << config_store << std::endl;
+ if ((config_store == "dbstore") ||
+ (config_store == "motr")) {
+ // These stores don't use the mon
+ flags |= CINIT_FLAG_NO_MON_CONFIG;
+ }
+
+ // Finish global init, indicating we already ran pre-init
+ return global_init(defaults, args, module_type, code_env, flags, false);
+}
}
extern int rgw_bucket_parse_bucket_instance(const std::string& bucket_instance, std::string *bucket_name, std::string *bucket_id, int *shard_id);
+
+boost::intrusive_ptr<CephContext>
+rgw_global_init(const std::map<std::string,std::string> *defaults,
+ std::vector < const char* >& args,
+ uint32_t module_type, code_environment_t code_env,
+ int flags);
// privileged ports
flags |= CINIT_FLAG_DEFER_DROP_PRIVILEGES;
- auto cct = global_init(&defaults, args, CEPH_ENTITY_TYPE_CLIENT,
- CODE_ENVIRONMENT_DAEMON, flags);
+ auto cct = rgw_global_init(&defaults, args, CEPH_ENTITY_TYPE_CLIENT,
+ CODE_ENVIRONMENT_DAEMON, flags);
// First, let's determine which frontends are configured.
list<string> frontends;
std::string rgw_store = (!rgw_d3n_datacache_enabled) ? "rados" : "d3n";
+ // Get the store backend
const auto& config_store = g_conf().get_val<std::string>("rgw_backend_store");
#ifdef WITH_RADOSGW_DBSTORE
if (config_store == "dbstore") {
int DBStore::get_config_key_val(string name, bufferlist *bl)
{
- return 0;
+ return -ENOTSUP;
}
int DBStore::meta_list_keys_init(const DoutPrefixProvider *dpp, const string& section, const string& marker, void** phandle)