]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/common_init: start log from common_init_finish (if not yet started) 27352/head
authorSage Weil <sage@redhat.com>
Wed, 3 Apr 2019 19:54:55 +0000 (14:54 -0500)
committerSage Weil <sage@redhat.com>
Thu, 4 Apr 2019 02:07:06 +0000 (21:07 -0500)
This captures any non-global_init users who created their cct but haven't
started up the log thread yet.  As long as common_init_finish() happens
after we have all of our config options (from the mon config or whatever),
we will log (or not log) to the right location(s).

Fixes a regression in cd6a5b9c40779956629803f222c365bdb291a169

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/common_init.cc
src/log/Log.h

index 9dd6be89b90c98e15f5cf9a860d9fd4153ebabaf..092804931be0b8d40a7021687c17ed6a3ccf0b88 100644 (file)
@@ -106,6 +106,10 @@ void common_init_finish(CephContext *cct)
   cct->init_crypto();
   ZTracer::ztrace_init();
 
+  if (!cct->_log->is_started()) {
+    cct->_log->start();
+  }
+
   int flags = cct->get_init_flags();
   if (!(flags & CINIT_FLAG_NO_DAEMON_ACTIONS))
     cct->start_service_thread();
index ac10cf9047d959a3637b1fb2ba2d6db02a63d387..a0b12e274323172cc4b7eeacb8ade39df05f4d0e 100644 (file)
@@ -82,6 +82,8 @@ class Log : private Thread
   void _log_message(const char *s, bool crash);
 
 public:
+  using Thread::is_started;
+
   Log(const SubsystemMap *s);
   ~Log() override;