diff --git a/include/dsn/tool-api/global_config.h b/include/dsn/tool-api/global_config.h index 51ac41405b..8bb9406019 100644 --- a/include/dsn/tool-api/global_config.h +++ b/include/dsn/tool-api/global_config.h @@ -169,7 +169,6 @@ struct service_spec std::vector app_specs; // auto-set - std::string dir_coredump; std::string dir_log; service_spec() {} diff --git a/src/runtime/service_api_c.cpp b/src/runtime/service_api_c.cpp index 649af2611b..fe47705f05 100644 --- a/src/runtime/service_api_c.cpp +++ b/src/runtime/service_api_c.cpp @@ -406,10 +406,7 @@ bool run(const char *config_file, } spec.data_dir = cdir; - // setup coredump dir - spec.dir_coredump = ::dsn::utils::filesystem::path_combine(cdir, "coredumps"); - dsn::utils::filesystem::create_directory(spec.dir_coredump); - ::dsn::utils::coredump::init(spec.dir_coredump.c_str()); + ::dsn::utils::coredump::init(); // setup log dir spec.dir_log = ::dsn::utils::filesystem::path_combine(cdir, "log"); diff --git a/src/utils/coredump.h b/src/utils/coredump.h index 4656acb836..2e57ad45b6 100644 --- a/src/utils/coredump.h +++ b/src/utils/coredump.h @@ -43,8 +43,8 @@ namespace utils { class coredump { public: - static void init(const char *dump_dir); + static void init(); static void write(); }; -} -} +} // namespace utils +} // namespace dsn diff --git a/src/utils/coredump.posix.cpp b/src/utils/coredump.posix.cpp index 5adf9c0c2d..e9b09e4f30 100644 --- a/src/utils/coredump.posix.cpp +++ b/src/utils/coredump.posix.cpp @@ -44,14 +44,11 @@ namespace dsn { namespace utils { -static std::string s_dump_dir; static void handle_core_dump(int); static void handle_term(int); -void coredump::init(const char *dump_dir) +void coredump::init() { - s_dump_dir = dump_dir; - signal(SIGSEGV, handle_core_dump); signal(SIGTERM, handle_term); }