From: Joao Eduardo Luis Date: Thu, 26 Sep 2019 07:54:07 +0000 (+0000) Subject: common: allow running without config X-Git-Tag: v15.1.0~648^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=065d12b826f7d2129bf9dcae1dbb60d84779fba4;p=ceph.git common: allow running without config If `--no-config-file` is specified, allow the caller to ignore the requirements to find a config file. This presumes that the caller either doesn't need to be configured, or that whatever it may need is provided via the cli. Signed-off-by: Joao Eduardo Luis --- diff --git a/doc/man/8/ceph-mon.rst b/doc/man/8/ceph-mon.rst index 0c2c57925e55..aeb6a38fc059 100644 --- a/doc/man/8/ceph-mon.rst +++ b/doc/man/8/ceph-mon.rst @@ -77,6 +77,11 @@ Options Specify a keyring for use with ``--mkfs``. +.. option:: --no-config-file + + Signal that we don't want to rely on a *ceph.conf*, either user provided + or the default, to run the daemon. This will entail providing all + necessary options to the daemon as arguments. Availability ============ diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 818f8d076751..662ed296a1e0 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -504,6 +504,9 @@ CephInitParameters ceph_argparse_early_args else if (ceph_argparse_witharg(args, i, &val, "--conf", "-c", (char*)NULL)) { *conf_file_list = val; } + else if (ceph_argparse_flag(args, i, "--no-config-file", (char*)NULL)) { + iparams.no_config_file = true; + } else if (ceph_argparse_witharg(args, i, &val, "--cluster", (char*)NULL)) { *cluster = val; } diff --git a/src/common/ceph_argparse.h b/src/common/ceph_argparse.h index 214b3dfb6727..1c5370a31504 100644 --- a/src/common/ceph_argparse.h +++ b/src/common/ceph_argparse.h @@ -37,6 +37,7 @@ public: uint32_t module_type; EntityName name; + bool no_config_file = false; }; /////////////////////// Functions /////////////////////// diff --git a/src/common/common_init.cc b/src/common/common_init.cc index 40b2d31092fb..2ad93a958c48 100644 --- a/src/common/common_init.cc +++ b/src/common/common_init.cc @@ -64,6 +64,8 @@ CephContext *common_preinit(const CephInitParameters &iparams, conf.set_val_default("log_flush_on_exit", "false"); } + conf.set_val("no_config_file", iparams.no_config_file ? "true" : "false"); + return cct; } #endif // #ifndef WITH_SEASTAR diff --git a/src/common/options.cc b/src/common/options.cc index a2958da725aa..bc92192b52cf 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -441,6 +441,18 @@ std::vector