Do not generate errors each time we fail to open a config file; only
generate one at the end if a search path was specified and none were
usable, right before we (already) exit. This avoids spamming stderr
about each path we tried in the search list before we found a good one.
Signed-off-by: Sage Weil <sage@inktank.com>
FILE *fp = fopen(fname.c_str(), "r");
if (!fp) {
ret = -errno;
- ostringstream oss;
- oss << "read_conf: failed to open '" << fname << "': " << cpp_strerror(ret);
- errors->push_back(oss.str());
return ret;
}
else if (ret == -EINVAL) {
if (!(flags & CINIT_FLAG_NO_DEFAULT_CONFIG_FILE)) {
if (conf_file_list.length()) {
- dout_emergency("global_init: unable to open config file.\n");
+ ostringstream oss;
+ oss << "global_init: unable to open config file from search list "
+ << conf_file_list << "\n";
+ dout_emergency(oss.str());
_exit(1);
} else {
derr <<"did not load config file, using default settings." << dendl;
# command-line arguments should override environment
$ env -u CEPH_CONF ceph-conf -c from-args
- global_init: unable to open config file. (re)
+ global_init: unable to open config file from search list from-args
[1]