conf.host is used by graylog for setting the "host" property.
and it is used when serving the "get config" command when the command
queries the "host", so better off setting it early before
flushing the log entries with graylog.
Fixes: https://tracker.ceph.com/issues/45457
Signed-off-by: Kefu Chai <kchai@redhat.com>
#include "common/ceph_context.h"
#include "common/config.h"
#include "common/dout.h"
+#include "common/hostname.h"
#include "common/strtol.h"
#include "common/valgrind.h"
#include "common/zipkin_trace.h"
conf.set_val("no_config_file", iparams.no_config_file ? "true" : "false");
+ if (conf->host.empty()) {
+ conf.set_val("host", ceph_get_short_hostname());
+ }
return cct;
}
#endif // #ifndef WITH_SEASTAR