Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: expand tilde for ~/.ceph/$cluster.conf #20774

Merged
merged 1 commit into from Mar 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/common/config.cc
Expand Up @@ -42,7 +42,7 @@ using std::ostringstream;
using std::pair;
using std::string;

static const char *CEPH_CONF_FILE_DEFAULT = "$data_dir/config, /etc/ceph/$cluster.conf, ~/.ceph/$cluster.conf, $cluster.conf"
static const char *CEPH_CONF_FILE_DEFAULT = "$data_dir/config, /etc/ceph/$cluster.conf, $home/.ceph/$cluster.conf, $cluster.conf"
#if defined(__FreeBSD__)
", /usr/local/etc/ceph/$cluster.conf"
#endif
Expand Down Expand Up @@ -1156,6 +1156,9 @@ Option::value_t md_config_t::_expand_meta(
out += stringify(getpid());
} else if (var == "cctid") {
out += stringify((unsigned long long)this);
} else if (var == "home") {
const char *home = getenv("HOME");
out = home ? std::string(home) : std::string();
} else {
if (var == "data_dir") {
var = data_dir_option;
Expand Down