summaryrefslogtreecommitdiff
path: root/src/ceph_osd.cc
diff options
context:
space:
mode:
authorGreg Farnum <gregory.farnum@dreamhost.com>2012-03-01 18:31:49 -0800
committerGreg Farnum <gregory.farnum@dreamhost.com>2012-03-02 12:32:36 -0800
commit26e48f4234c051edeeac6e7ba739f911d9454b9a (patch)
treeeaefc0e98466cc291d0a130a3126417b8e2f9232 /src/ceph_osd.cc
parent29be52820d6b16cb606741bc69cc6baebd14bc5b (diff)
downloadceph-26e48f4234c051edeeac6e7ba739f911d9454b9a.tar.gz
msgr: Require that init functions are called before bind() and start().
Fix up callers to handle these constraints. Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Diffstat (limited to 'src/ceph_osd.cc')
-rw-r--r--src/ceph_osd.cc30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc
index 98a998d906c..3bf1cbaf286 100644
--- a/src/ceph_osd.cc
+++ b/src/ceph_osd.cc
@@ -312,21 +312,6 @@ int main(int argc, const char **argv)
messenger_hbin->set_cluster_protocol(CEPH_OSD_PROTOCOL);
messenger_hbout->set_cluster_protocol(CEPH_OSD_PROTOCOL);
- r = client_messenger->bind(g_conf->public_addr);
- if (r < 0)
- exit(1);
- r = cluster_messenger->bind(g_conf->cluster_addr);
- if (r < 0)
- exit(1);
-
- // hb should bind to same ip as cluster_addr (if specified)
- entity_addr_t hb_addr = g_conf->cluster_addr;
- if (!hb_addr.is_blank_ip())
- hb_addr.set_port(0);
- r = messenger_hbout->bind(hb_addr);
- if (r < 0)
- exit(1);
-
global_print_banner();
cout << "starting osd." << whoami
@@ -366,6 +351,21 @@ int main(int argc, const char **argv)
cluster_messenger->set_policy(entity_name_t::TYPE_CLIENT,
Messenger::Policy::stateless_server(0, 0));
+ r = client_messenger->bind(g_conf->public_addr);
+ if (r < 0)
+ exit(1);
+ r = cluster_messenger->bind(g_conf->cluster_addr);
+ if (r < 0)
+ exit(1);
+
+ // hb should bind to same ip as cluster_addr (if specified)
+ entity_addr_t hb_addr = g_conf->cluster_addr;
+ if (!hb_addr.is_blank_ip())
+ hb_addr.set_port(0);
+ r = messenger_hbout->bind(hb_addr);
+ if (r < 0)
+ exit(1);
+
// Set up crypto, daemonize, etc.
// Leave stderr open in case we need to report errors.
global_init_daemonize(g_ceph_context, CINIT_FLAG_NO_CLOSE_STDERR);