From: Loic Dachary Date: Sun, 29 Dec 2013 11:26:14 +0000 (+0100) Subject: mon: add flags argument to common_init_finish X-Git-Tag: v0.75~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4438410941df3bae7d6871a44c6ea10a1025a57;p=ceph.git 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 --- diff --git a/src/ceph_mon.cc b/src/ceph_mon.cc index 863bce38b8a..28b9b150333 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 8fb688cd8d3..6538b18ab2d 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 f48b349bf00..d6aa9fa32c1 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