* crimson/osd/main.cc:
if crimson-osd is launched as a daemon, we can always stop it using
SIGINT, and seastar::reactor does stop itself when handling this signal.
but if we start crimson-osd as an ordinary command line tool, we should
stop it explicitly after it is done with its job. so call
seastar::engine().exit().
* crimson/osd/osd.cc:
do not stop unitialized services in OSD::stop(). OSD is initialized as
a sharded service in main.cc, so we have to stop it before stopping
engine. if OSD is used for mkfs, the internal services like heartbeat,
monc, mgrc are not initialized at all, so we should not stop them in
this case. and in theory, user could stop crimson-osd when it boots,
so we need to check the pointers for null before dereferencing them.
Signed-off-by: Kefu Chai <kchai@redhat.com>
}).then([&osd, mkfs = config.count("mkfs")] {
if (mkfs) {
return osd.invoke_on(0, &OSD::mkfs,
- local_conf().get_val<uuid_d>("fsid"));
+ local_conf().get_val<uuid_d>("fsid"))
+ .then([] { seastar::engine().exit(0); });
} else {
return osd.invoke_on(0, &OSD::start);
}