]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: Bring daemonization in line with other daemons
authorDavid Zafman <dzafman@redhat.com>
Tue, 9 May 2017 23:52:15 +0000 (16:52 -0700)
committerDavid Zafman <dzafman@redhat.com>
Fri, 23 Jun 2017 15:02:50 +0000 (08:02 -0700)
ceph-mon doesn't use the global_init_daemonize() as the other
daemons do.  This resulted in the daemon staying in the session
of the process that started it.  In testing if I terminated a
test script only ceph-mon would be exit.

Signed-off-by: David Zafman <dzafman@redhat.com>
src/ceph_mon.cc

index 0b5d4edfd7934f2f551818d22dea5a909120ecd3..de1c10e4c9b1630b48716d857b98a85d2ab7bce2 100644 (file)
@@ -500,6 +500,7 @@ int main(int argc, const char **argv)
           derr << err_msg << dendl;
         prefork.exit(err);
       }
+      setsid();
       global_init_postfork_start(g_ceph_context);
     }
     common_init_finish(g_ceph_context);