From d4438410941df3bae7d6871a44c6ea10a1025a57 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Sun, 29 Dec 2013 12:26:14 +0100 Subject: [PATCH] mon: add flags argument to common_init_finish It is the same flag that is given to common_preinit. The service thread is not initialized if CINIT_FLAG_NO_DAEMON_ACTIONS is set. Signed-off-by: Loic Dachary --- src/ceph_mon.cc | 2 +- src/common/common_init.cc | 6 ++++-- src/common/common_init.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc index 863bce38b8a5..28b9b1503330 100644 --- a/src/ceph_mon.cc +++ b/src/ceph_mon.cc @@ -213,7 +213,7 @@ int main(int argc, const char **argv) // resolve public_network -> public_addr pick_addresses(g_ceph_context, CEPH_PICK_ADDRESS_PUBLIC); - common_init_finish(g_ceph_context); + common_init_finish(g_ceph_context, flags); bufferlist monmapbl, osdmapbl; std::string error; diff --git a/src/common/common_init.cc b/src/common/common_init.cc index 8fb688cd8d3f..6538b18ab2df 100644 --- a/src/common/common_init.cc +++ b/src/common/common_init.cc @@ -112,10 +112,12 @@ void complain_about_parse_errors(CephContext *cct, /* Please be sure that this can safely be called multiple times by the * same application. */ -void common_init_finish(CephContext *cct) +void common_init_finish(CephContext *cct, int flags) { ceph::crypto::init(cct); - cct->start_service_thread(); + + if (!(flags & CINIT_FLAG_NO_DAEMON_ACTIONS)) + cct->start_service_thread(); if (cct->_conf->lockdep) { g_lockdep = true; diff --git a/src/common/common_init.h b/src/common/common_init.h index f48b349bf001..d6aa9fa32c1b 100644 --- a/src/common/common_init.h +++ b/src/common/common_init.h @@ -75,6 +75,6 @@ void complain_about_parse_errors(CephContext *cct, * libraries. The most obvious reason for this is that the threads started by * the Ceph libraries would be destroyed by a fork(). */ -void common_init_finish(CephContext *cct); +void common_init_finish(CephContext *cct, int flags = 0); #endif -- 2.47.3