Skip to content

Commit

Permalink
add core dump path (TuGraph-family#698)
Browse files Browse the repository at this point in the history
* add core dump

* add core dump

* fix cpplint
  • Loading branch information
lipanpan03 authored Oct 16, 2024
1 parent f625d40 commit 12d9a4c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/server/lgraph_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace brpc {
DECLARE_bool(usercode_in_pthread);
}
#endif
#include <sys/resource.h>

namespace lgraph {
static Signal _kill_signal_;
Expand Down Expand Up @@ -164,6 +165,16 @@ int LGraphServer::Start() {
<< "Server is configured with the following parameters:\n"
<< config_->FormatAsString();
LOG_INFO() << header.str();
struct rlimit rlim{};
getrlimit(RLIMIT_CORE, &rlim);
LOG_INFO() << "The maximum limit of core file size is " << rlim.rlim_cur;
std::ifstream file("/proc/sys/kernel/core_pattern");
if (file.is_open()) {
std::string content((std::istreambuf_iterator<char>(file)),
(std::istreambuf_iterator<char>()));
LOG_INFO() << "The path to the core file is " << content;
file.close();
}

// starting audit log
if (config_->audit_log_dir.empty())
Expand Down

0 comments on commit 12d9a4c

Please sign in to comment.