]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: die on bind() failure 20595/head
authorJohn Spray <john.spray@redhat.com>
Mon, 26 Feb 2018 17:11:16 +0000 (17:11 +0000)
committerJohn Spray <john.spray@redhat.com>
Mon, 26 Feb 2018 17:14:03 +0000 (17:14 +0000)
Previously, the daemon would get wedged if it
competed for the same port as another daemon
on the same host and lost.

Fixes: https://tracker.ceph.com/issues/23037
Signed-off-by: John Spray <john.spray@redhat.com>
src/mgr/Mgr.cc

index 6c92395bcfa52dd12dcce9e5733be95a675e09ea..e2b73fdee64d644275a4b17a30f4d3e3ca588b28 100644 (file)
@@ -159,8 +159,10 @@ void Mgr::init()
   // Start communicating with daemons to learn statistics etc
   int r = server.init(monc->get_global_id(), client_messenger->get_myaddr());
   if (r < 0) {
-    derr << "Initialize server fail"<< dendl;
-    return;
+    derr << "Initialize server fail: " << cpp_strerror(r) << dendl;
+    // This is typically due to a bind() failure, so let's let
+    // systemd restart us.
+    exit(1);
   }
   dout(4) << "Initialized server at " << server.get_myaddr() << dendl;