do not create default dataDir on startup
This commit is contained in:
parent
66771b8de8
commit
c5a74d6f99
|
@ -467,6 +467,12 @@ int32_t taosCreateLog(const char *logname, int32_t logFileNum, const char *cfgDi
|
||||||
|
|
||||||
taosSetAllDebugFlag(cfgGetItem(pCfg, "debugFlag")->i32);
|
taosSetAllDebugFlag(cfgGetItem(pCfg, "debugFlag")->i32);
|
||||||
|
|
||||||
|
if (taosMkDir(tsLogDir) != 0) {
|
||||||
|
uError("failed to create dir:%s since %s", tsLogDir, terrstr());
|
||||||
|
cfgCleanup(pCfg);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (taosInitLog(logname, logFileNum) != 0) {
|
if (taosInitLog(logname, logFileNum) != 0) {
|
||||||
uError("failed to init log file since %s", terrstr());
|
uError("failed to init log file since %s", terrstr());
|
||||||
cfgCleanup(pCfg);
|
cfgCleanup(pCfg);
|
||||||
|
@ -514,6 +520,16 @@ int32_t taosInitCfg(const char *cfgDir, const char *envFile, const char *apolloU
|
||||||
}
|
}
|
||||||
taosSetSystemCfg(tsCfg);
|
taosSetSystemCfg(tsCfg);
|
||||||
|
|
||||||
|
if (taosMkDir(tsTempDir) != 0) {
|
||||||
|
uError("failed to create dir:%s since %s", tsTempDir, terrstr());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!tsc && taosMkDir(tsDataDir) != 0) {
|
||||||
|
uError("failed to create dir:%s since %s", tsDataDir, terrstr());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
cfgDumpCfg(tsCfg, tsc, false);
|
cfgDumpCfg(tsCfg, tsc, false);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,10 +145,12 @@ static int32_t cfgCheckAndSetDir(SConfigItem *pItem, const char *inputDir) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
if (taosMkDir(fullDir) != 0) {
|
if (taosMkDir(fullDir) != 0) {
|
||||||
uError("failed to create dir:%s realpath:%s since %s", inputDir, fullDir, terrstr());
|
uError("failed to create dir:%s realpath:%s since %s", inputDir, fullDir, terrstr());
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
cfgFreeItem(pItem);
|
cfgFreeItem(pItem);
|
||||||
pItem->str = strdup(fullDir);
|
pItem->str = strdup(fullDir);
|
||||||
|
|
Loading…
Reference in New Issue