diff --git a/src/os/linux/src/tsystem.c b/src/os/linux/src/tsystem.c index b01f0b7926993cf8eccee5390d5ccf5d87b6e1c1..70b970e2a81b6f81209e3f9352a5621e008e14d0 100644 --- a/src/os/linux/src/tsystem.c +++ b/src/os/linux/src/tsystem.c @@ -586,9 +586,13 @@ void taosKillSystem() { kill(tsProcId, 2); } - +extern int tsEnableCoreFile; int _sysctl(struct __sysctl_args *args ); void taosSetCoreDump() { + if (0 == tsEnableCoreFile) { + return; + } + // 1. set ulimit -c unlimited struct rlimit rlim; struct rlimit rlim_new; diff --git a/src/util/src/tglobalcfg.c b/src/util/src/tglobalcfg.c index 286983b0b291c47f214c03b4acf55a226a82f8c6..e9cfbbc718e4470b2cb4219b3ee132fd20fc318b 100644 --- a/src/util/src/tglobalcfg.c +++ b/src/util/src/tglobalcfg.c @@ -163,6 +163,7 @@ int tsTelegrafUseFieldNum = 0; int tsAdminRowLimit = 10240; int tsTscEnableRecordSql = 0; +int tsEnableCoreFile = 0; int tsRpcTimer = 300; int tsRpcMaxTime = 600; // seconds; @@ -772,6 +773,11 @@ static void doInitGlobalConfig() { tsInitConfigOption(cfg++, "tscEnableRecordSql", &tsTscEnableRecordSql, TSDB_CFG_VTYPE_INT, TSDB_CFG_CTYPE_B_CONFIG, 1, 100000, 0, TSDB_CFG_UTYPE_NONE); + + tsInitConfigOption(cfg++, "enableCoreFile", &tsEnableCoreFile, TSDB_CFG_VTYPE_INT, + TSDB_CFG_CTYPE_B_CONFIG, + 1, 100000, 0, TSDB_CFG_UTYPE_NONE); + // version info tsInitConfigOption(cfg++, "gitinfo", gitinfo, TSDB_CFG_VTYPE_STRING, TSDB_CFG_CTYPE_B_SHOW | TSDB_CFG_CTYPE_B_CLIENT, @@ -1161,4 +1167,4 @@ void tsPrintGlobalConfigSpec() { pPrint(" dataDir: %s", dataDir); } -#endif \ No newline at end of file +#endif