#include <iostream>
#include <random>
+#include <seastar/apps/lib/stop_signal.hh>
#include <seastar/core/app-template.hh>
#include <seastar/core/print.hh>
#include <seastar/core/thread.hh>
#include "global/pidfile.h"
#include "osd.h"
-#include "stop_signal.h"
using config_t = crimson::common::ConfigProxy;
int main(int argc, char* argv[])
{
- seastar::app_template app;
+ seastar::app_template::config app_cfg;
+ app_cfg.name = "Crimson";
+ app_cfg.auto_handle_sigint_sigterm = false;
+ seastar::app_template app(std::move(app_cfg));
app.add_options()
("mkkey", "generate a new secret key. "
"This is normally used in combination with --mkfs")
return seastar::async([&] {
try {
FatalSignal fatal_signal;
- StopSignal should_stop;
+ seastar_apps_lib::stop_signal should_stop;
if (config.count("debug")) {
seastar::global_logger_registry().set_all_loggers_level(
seastar::log_level::debug
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
-// vim: ts=8 sw=2 smarttab
-
-#include "stop_signal.h"
-
-#include <csignal>
-#include <seastar/core/reactor.hh>
-
-StopSignal::StopSignal()
-{
- seastar::engine().handle_signal(SIGINT, [this] { signaled(); });
- seastar::engine().handle_signal(SIGTERM, [this] { signaled(); });
-}
-
-StopSignal::~StopSignal()
-{
- seastar::engine().handle_signal(SIGINT, [] {});
- seastar::engine().handle_signal(SIGTERM, [] {});
-}
-
-seastar::future<> StopSignal::wait()
-{
- return should_stop.wait([this] { return caught; });
-}
-
-void StopSignal::signaled()
-{
- if (caught) {
- return;
- }
- caught = true;
- should_stop.signal();
-}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
-// vim: ts=8 sw=2 smarttab
-
-#pragma once
-
-#include <seastar/core/condition-variable.hh>
-#include <seastar/core/sharded.hh>
-
-class StopSignal {
-public:
- StopSignal();
- ~StopSignal();
- seastar::future<> wait();
-
-private:
- void signaled();
-
-private:
- bool caught;
- seastar::condition_variable should_stop;
-};