taosd: allow -C option before -c
This commit is contained in:
parent
30b79431d5
commit
8249a2fd8e
|
@ -23,6 +23,8 @@ static void signal_handler(int32_t signum, siginfo_t *sigInfo, void *context);
|
||||||
static tsem_t exitSem;
|
static tsem_t exitSem;
|
||||||
|
|
||||||
int32_t main(int32_t argc, char *argv[]) {
|
int32_t main(int32_t argc, char *argv[]) {
|
||||||
|
int dump_config = 0;
|
||||||
|
|
||||||
// Set global configuration file
|
// Set global configuration file
|
||||||
for (int32_t i = 1; i < argc; ++i) {
|
for (int32_t i = 1; i < argc; ++i) {
|
||||||
if (strcmp(argv[i], "-c") == 0) {
|
if (strcmp(argv[i], "-c") == 0) {
|
||||||
|
@ -37,17 +39,7 @@ int32_t main(int32_t argc, char *argv[]) {
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
} else if (strcmp(argv[i], "-C") == 0) {
|
} else if (strcmp(argv[i], "-C") == 0) {
|
||||||
tscEmbedded = 1;
|
dump_config = 1;
|
||||||
taosInitGlobalCfg();
|
|
||||||
taosReadGlobalLogCfg();
|
|
||||||
|
|
||||||
if (!taosReadGlobalCfg()) {
|
|
||||||
printf("TDengine read global config failed");
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
taosDumpGlobalCfg();
|
|
||||||
exit(EXIT_SUCCESS);
|
|
||||||
} else if (strcmp(argv[i], "-V") == 0) {
|
} else if (strcmp(argv[i], "-V") == 0) {
|
||||||
#ifdef _ACCT
|
#ifdef _ACCT
|
||||||
char *versionStr = "enterprise";
|
char *versionStr = "enterprise";
|
||||||
|
@ -100,6 +92,20 @@ int32_t main(int32_t argc, char *argv[]) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (0 != dump_config) {
|
||||||
|
tscEmbedded = 1;
|
||||||
|
taosInitGlobalCfg();
|
||||||
|
taosReadGlobalLogCfg();
|
||||||
|
|
||||||
|
if (!taosReadGlobalCfg()) {
|
||||||
|
printf("TDengine read global config failed");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
taosDumpGlobalCfg();
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
if (tsem_init(&exitSem, 0, 0) != 0) {
|
if (tsem_init(&exitSem, 0, 0) != 0) {
|
||||||
printf("failed to create exit semphore\n");
|
printf("failed to create exit semphore\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
Loading…
Reference in New Issue