diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index 6c685b06b4e109cee43262a2ae382f56c495d9ce..bef05dde80cdab990464903b86c3b50196cf001d 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -77,7 +77,7 @@ void taos_init_imp() { // For log directory if (stat(logDir, &dirstat) < 0) mkdir(logDir, 0755); - sprintf(temp, "%s/taoslog", logDir); + sprintf(temp, "%s/%slog", logDir, DB_CLIENT_NAME); if (taosInitLog(temp, tsNumOfLogLines, 10) < 0) { printf("failed to open log file in directory:%s\n", logDir); } diff --git a/src/kit/shell/src/shellDarwin.c b/src/kit/shell/src/shellDarwin.c index b624f5ee68535026580af25aa962a8f6a79f963e..5a4c23e5c6b01fc897f709acb14e4988cf8ace28 100644 --- a/src/kit/shell/src/shellDarwin.c +++ b/src/kit/shell/src/shellDarwin.c @@ -32,16 +32,16 @@ void insertChar(Command *cmd, char *c, int size); void printHelp() { char indent[10] = " "; - printf("taos shell is used to test the TDEngine database\n"); + printf("%s shell is used to test the %s database\n", DB_CLIENT_NAME, DB_FULL_NAME); printf("%s%s\n", indent, "-h"); - printf("%s%s%s\n", indent, indent, "TDEngine server IP address to connect. The default host is localhost."); + printf("%s%s%s\n", indent, indent, DB_FULL_NAME" server IP address to connect. The default host is localhost."); printf("%s%s\n", indent, "-p"); printf("%s%s%s\n", indent, indent, "The password to use when connecting to the server."); printf("%s%s\n", indent, "-P"); printf("%s%s%s\n", indent, indent, "The TCP/IP port number to use for the connection"); printf("%s%s\n", indent, "-u"); - printf("%s%s%s\n", indent, indent, "The TDEngine user name to use when connecting to the server."); + printf("%s%s%s\n", indent, indent, "The "DB_FULL_NAME" user name to use when connecting to the server."); printf("%s%s\n", indent, "-c"); printf("%s%s%s\n", indent, indent, "Configuration directory."); printf("%s%s\n", indent, "-s"); diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 27a4aaaa0cd24d84b46003ec3195f130d3ee8c85..1d530ea0b8341138e7c1a28fd82656ca93b7c1e6 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -26,10 +26,12 @@ #include /**************** Global variables ****************/ -char CLIENT_VERSION[] = "Welcome to the TDengine shell from %s, Client Version:%s\n" - "Copyright (c) 2017 by TAOS Data, Inc. All rights reserved.\n\n"; -char PROMPT_HEADER[] = "taos> "; -char CONTINUE_PROMPT[] = " -> "; +char CLIENT_VERSION[] = "Welcome to the " DB_FULL_NAME " shell from %s, Client Version:%s\n" + "Copyright (c) 2017 by " DB_COPYRIGHT ", Inc. All rights reserved.\n\n"; +//char PROMPT_HEADER[] = "taos> "; +//char CONTINUE_PROMPT[] = " -> "; +char PROMPT_HEADER[16] = {0}; +char CONTINUE_PROMPT[16] = {0}; int prompt_size = 6; TAOS_RES *result = NULL; History history; @@ -38,6 +40,14 @@ History history; * FUNCTION: Initialize the shell. */ TAOS *shellInit(struct arguments *args) { + sprintf(PROMPT_HEADER, "%s> ", DB_CLIENT_NAME); + int len = strlen(PROMPT_HEADER); + for (int i = 0; i < len - 3; ++i) { + CONTINUE_PROMPT[i] = ' '; + } + strcpy(CONTINUE_PROMPT + len - 3, "-> "); + prompt_size = strlen(DB_CLIENT_NAME) + 2; + printf("\n"); printf(CLIENT_VERSION, osName, taos_get_client_info()); fflush(stdout); diff --git a/src/kit/shell/src/shellLinux.c b/src/kit/shell/src/shellLinux.c index 081b9eae319f3570ab11b67e075292648dd76161..b1578739cd701924cbd930a1d77804e3aafcca89 100644 --- a/src/kit/shell/src/shellLinux.c +++ b/src/kit/shell/src/shellLinux.c @@ -29,14 +29,14 @@ struct termios oldtio; extern int wcwidth(wchar_t c); void insertChar(Command *cmd, char *c, int size); const char *argp_program_version = version; -const char *argp_program_bug_address = ""; +const char *argp_program_bug_address = ""; static char doc[] = ""; static char args_doc[] = ""; static struct argp_option options[] = { - {"host", 'h', "HOST", 0, "TDEngine server IP address to connect. The default host is localhost."}, + {"host", 'h', "HOST", 0, DB_FULL_NAME" server IP address to connect. The default host is localhost."}, {"password", 'p', "PASSWORD", OPTION_ARG_OPTIONAL, "The password to use when connecting to the server."}, {"port", 'P', "PORT", 0, "The TCP/IP port number to use for the connection."}, - {"user", 'u', "USER", 0, "The TDEngine user name to use when connecting to the server."}, + {"user", 'u', "USER", 0, "The "DB_FULL_NAME" user name to use when connecting to the server."}, {"config-dir", 'c', "CONFIG_DIR", 0, "Configuration directory."}, {"commands", 's', "COMMANDS", 0, "Commands to run without enter the shell."}, {"raw-time", 'r', 0, 0, "Output time as uint64_t."}, diff --git a/src/kit/shell/src/shellWindows.c b/src/kit/shell/src/shellWindows.c index 61e6bcaf30b887a445134b28b0af022127b3e8ab..1d1cd400c13036c41714311a4c7781c69efc236f 100644 --- a/src/kit/shell/src/shellWindows.c +++ b/src/kit/shell/src/shellWindows.c @@ -17,16 +17,16 @@ void printHelp() { char indent[10] = " "; - printf("taos shell is used to test the TDEngine database\n"); + printf("%s shell is used to test the %s database\n", DB_CLIENT_NAME, DB_FULL_NAME); printf("%s%s\n", indent, "-h"); - printf("%s%s%s\n", indent, indent, "TDEngine server IP address to connect. The default host is localhost."); + printf("%s%s%s\n", indent, indent, DB_FULL_NAME" server IP address to connect. The default host is localhost."); printf("%s%s\n", indent, "-p"); printf("%s%s%s\n", indent, indent, "The password to use when connecting to the server."); printf("%s%s\n", indent, "-P"); printf("%s%s%s\n", indent, indent, "The TCP/IP port number to use for the connection"); printf("%s%s\n", indent, "-u"); - printf("%s%s%s\n", indent, indent, "The TDEngine user name to use when connecting to the server."); + printf("%s%s%s\n", indent, indent, "The "DB_FULL_NAME" user name to use when connecting to the server."); printf("%s%s\n", indent, "-c"); printf("%s%s%s\n", indent, indent, "Configuration directory."); printf("%s%s\n", indent, "-s"); diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 6364e70788652e5f37fb276a6ebc0ae0b1a0288b..b070fb0a7a3e5c418a4ce053cf5d072c9a9953ca 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -46,10 +46,10 @@ extern char configDir[]; /* The options we understand. */ static struct argp_option options[] = { - {0, 'h', "host", 0, "The host to connect to TDEngine. Default is localhost.", 0}, + {0, 'h', "host", 0, "The host to connect to "DB_CLIENT_NAME". Default is localhost.", 0}, {0, 'p', "port", 0, "The TCP/IP port number to use for the connection. Default is 0.", 1}, - {0, 'u', "user", 0, "The TDEngine user name to use when connecting to the server. Default is 'root'.", 2}, - {0, 'a', "password", 0, "The password to use when connecting to the server. Default is 'taosdata'.", 3}, + {0, 'u', "user", 0, "The "DB_FULL_NAME" user name to use when connecting to the server. Default is 'root'.", 2}, + {0, 'a', "password", 0, "The password to use when connecting to the server. Default is '"DB_COMPANY"'.", 3}, {0, 'd', "database", 0, "Destination database. Default is 'test'.", 3}, {0, 'm', "table_prefix", 0, "Table prefix name. Default is 't'.", 3}, {0, 'M', 0, 0, "Use metric flag.", 13}, @@ -272,7 +272,7 @@ int main(int argc, char *argv[]) { struct arguments arguments = {NULL, // host 0, // port "root", // user - "taosdata", // password + DB_COMPANY, // password "test", // database "t", // tb_prefix false, // use_metric @@ -383,7 +383,7 @@ int main(int argc, char *argv[]) { taos_init(); TAOS *taos = taos_connect(ip_addr, user, pass, NULL, port); if (taos == NULL) { - fprintf(stderr, "Failed to connect to TDengine, reason:%s\n", taos_errstr(taos)); + fprintf(stderr, "Failed to connect to database, reason:%s\n", taos_errstr(taos)); taos_close(taos); return 1; } diff --git a/src/kit/taosdump/taosdump.c b/src/kit/taosdump/taosdump.c index 62cfa911ae685d0a7f895052ef9003aa97744c87..46d82e43e4cb3c144f41e7b1907c02ffb06475d7 100644 --- a/src/kit/taosdump/taosdump.c +++ b/src/kit/taosdump/taosdump.c @@ -138,7 +138,7 @@ static int64_t totalDumpOutRows = 0; SDbInfo **dbInfos = NULL; const char *argp_program_version = version; -const char *argp_program_bug_address = ""; +const char *argp_program_bug_address = ""; /* Program documentation. */ static char doc[] = ""; @@ -157,28 +157,28 @@ static char args_doc[] = "dbname [tbname ...]\n--databases dbname ...\n--all-dat /* The options we understand. */ static struct argp_option options[] = { // connection option - {"host", 'h', "HOST", 0, "Server host dumping data from. Default is localhost.", 0}, - {"user", 'u', "USER", 0, "User name used to connect to server. Default is root.", 0}, - {"password", 'p', "PASSWORD", 0, "User password to connect to server. Default is taosdata.", 0}, - {"port", 'P', "PORT", 0, "Port to connect", 0}, - {"cversion", 'v', "CVERION", 0, "client version", 0}, + {"host", 'h', "HOST", 0, "Server host dumping data from. Default is localhost.", 0}, + {"user", 'u', "USER", 0, "User name used to connect to server. Default is root.", 0}, + {"password", 'p', "PASSWORD", 0, "User password to connect to server. Default is "DB_COMPANY".", 0}, + {"port", 'P', "PORT", 0, "Port to connect", 0}, + {"cversion", 'v', "CVERION", 0, "client version", 0}, // input/output file - {"outpath", 'o', "OUTPATH", 0, "Output file path.", 1}, - {"inpath", 'i', "INPATH", 0, "Input file path.", 1}, - {"config", 'c', "CONFIG_DIR", 0, "Configure directory. Default is /etc/taos/taos.cfg.", 1}, - {"encode", 'e', "ENCODE", 0, "Input file encoding.", 1}, + {"outpath", 'o', "OUTPATH", 0, "Output file path.", 1}, + {"inpath", 'i', "INPATH", 0, "Input file path.", 1}, + {"config", 'c', "CONFIG_DIR", 0, "Configure directory. Default is /etc/"DB_CLIENT_NAME"/"DB_CLIENT_NAME".cfg.", 1}, + {"encode", 'e', "ENCODE", 0, "Input file encoding.", 1}, // dump unit options - {"all-databases", 'A', 0, 0, "Dump all databases.", 2}, - {"databases", 'B', 0, 0, "Dump assigned databases", 2}, + {"all-databases", 'A', 0, 0, "Dump all databases.", 2}, + {"databases", 'B', 0, 0, "Dump assigned databases", 2}, // dump format options - {"schemaonly", 's', 0, 0, "Only dump schema.", 3}, - {"with-property", 'M', 0, 0, "Dump schema with properties.", 3}, - {"start-time", 'S', "START_TIME", 0, "Start time to dump.", 3}, - {"end-time", 'E', "END_TIME", 0, "End time to dump.", 3}, - {"data-batch", 'N', "DATA_BATCH", 0, "Number of data point per insert statement. Default is 1.", 3}, - {"table-batch", 'T', "TABLE_BATCH", 0, "Number of table dumpout into one output file. Default is 1.", 3}, - {"thread_num", 't', "THREAD_NUM", 0, "Number of thread for dump in file. Default is 5.", 3}, - {"allow-sys", 'a', 0, 0, "Allow to dump sys database", 3}, + {"schemaonly", 's', 0, 0, "Only dump schema.", 3}, + {"with-property", 'M', 0, 0, "Dump schema with properties.", 3}, + {"start-time", 'S', "START_TIME", 0, "Start time to dump.", 3}, + {"end-time", 'E', "END_TIME", 0, "End time to dump.", 3}, + {"data-batch", 'N', "DATA_BATCH", 0, "Number of data point per insert statement. Default is 1.", 3}, + {"table-batch", 'T', "TABLE_BATCH", 0, "Number of table dumpout into one output file. Default is 1.", 3}, + {"thread_num", 't', "THREAD_NUM", 0, "Number of thread for dump in file. Default is 5.", 3}, + {"allow-sys", 'a', 0, 0, "Allow to dump sys database", 3}, {0}}; /* Used by main to communicate with parse_opt. */ @@ -337,7 +337,7 @@ struct arguments tsArguments = { // connection option NULL, "root", - "taosdata", + DB_COMPANY, 0, "", // outpath and inpath @@ -644,7 +644,7 @@ int taosDumpOut(struct arguments *arguments) { /* Connect to server */ taos = taos_connect(arguments->host, arguments->user, arguments->password, NULL, arguments->port); if (taos == NULL) { - fprintf(stderr, "failed to connect to TDengine server\n"); + fprintf(stderr, "failed to connect to database server\n"); goto _exit_failure; } @@ -1457,7 +1457,7 @@ int taosCheckParam(struct arguments *arguments) { if (arguments->arg_list_len == 0) { if ((!arguments->all_databases) && (!arguments->isDumpIn)) { - fprintf(stderr, "taosdump requires parameters\n"); + fprintf(stderr, DB_CLIENT_NAME"dump requires parameters\n"); return -1; } } @@ -2059,7 +2059,7 @@ int taosDumpIn(struct arguments *arguments) { taos = taos_connect(arguments->host, arguments->user, arguments->password, NULL, arguments->port); if (taos == NULL) { - fprintf(stderr, "failed to connect to TDengine server\n"); + fprintf(stderr, "failed to connect to database server\n"); return -1; } diff --git a/src/modules/http/src/httpAuth.c b/src/modules/http/src/httpAuth.c index 4503accc0acdc74f1035b91bb2b85a344eb143fe..3aea57b5046d036b7121027e324f4577e6f1ae73 100644 --- a/src/modules/http/src/httpAuth.c +++ b/src/modules/http/src/httpAuth.c @@ -113,7 +113,7 @@ bool httpGenTaosdAuthToken(HttpContext *pContext, char *token, int maxLen) { free(encrypt); free(base64); - httpTrace("context:%p, fd:%d, ip:%s, gen taosd token:%s", pContext, pContext->fd, pContext->ipstr, token); + httpTrace("context:%p, fd:%d, ip:%s, gen %s token:%s", pContext, pContext->fd, pContext->ipstr, DB_SERVICE_NAME, token); return true; } diff --git a/src/modules/http/src/httpSql.c b/src/modules/http/src/httpSql.c index 4696e80dc785112a8345e6a74f42dd86e0295fa7..4da73479d841ce97639bacab6865f03a35173852 100644 --- a/src/modules/http/src/httpSql.c +++ b/src/modules/http/src/httpSql.c @@ -358,7 +358,7 @@ void httpProcessRequestCb(void *param, TAOS_RES *result, int code) { return; } - httpTrace("context:%p, fd:%d, ip:%s, user:%s, connect tdengine success, taos:%p", pContext, pContext->fd, + httpTrace("context:%p, fd:%d, ip:%s, user:%s, connect database success, taos:%p", pContext, pContext->fd, pContext->ipstr, pContext->user, pContext->taos); if (pContext->taos == NULL) { httpError("context:%p, fd:%d, ip:%s, user:%s, login error, taos is empty", pContext, pContext->fd, pContext->ipstr, @@ -384,7 +384,7 @@ void httpProcessRequest(HttpContext *pContext) { pContext->reqType == HTTP_REQTYPE_LOGIN) { taos_connect_a(NULL, pContext->user, pContext->pass, "", 0, httpProcessRequestCb, (void *)pContext, &(pContext->taos)); - httpTrace("context:%p, fd:%d, ip:%s, user:%s, try connect tdengine, taos:%p", pContext, pContext->fd, + httpTrace("context:%p, fd:%d, ip:%s, user:%s, try connect database, taos:%p", pContext, pContext->fd, pContext->ipstr, pContext->user, pContext->taos); } else { httpAccessSession(pContext); diff --git a/src/modules/monitor/src/monitorSystem.c b/src/modules/monitor/src/monitorSystem.c index f403a272935b67db3f8cdded152b41be19f22fd5..34a9efa599efe101c5550cfeff5ab7c73e474947 100644 --- a/src/modules/monitor/src/monitorSystem.c +++ b/src/modules/monitor/src/monitorSystem.c @@ -154,8 +154,8 @@ void dnodeBuildMonitorSql(char *sql, int cmd) { } else if (cmd == MONITOR_CMD_CREATE_MT_DN) { snprintf(sql, SQL_LENGTH, "create table if not exists %s.dn(ts timestamp" - ", cpu_taosd float, cpu_system float, cpu_cores int" - ", mem_taosd float, mem_system float, mem_total int" + ", cpu_"DB_SERVICE_NAME" float, cpu_system float, cpu_cores int" + ", mem_"DB_SERVICE_NAME" float, mem_system float, mem_total int" ", disk_used float, disk_total int" ", band_speed float" ", io_read float, io_write float" diff --git a/src/os/darwin/src/tdarwin.c b/src/os/darwin/src/tdarwin.c index af3b1bd8a50d9f52d5f81f4dd42f483c510866c9..f4a79ecff1df3f8f49dc8923ecc9641eec60c769 100644 --- a/src/os/darwin/src/tdarwin.c +++ b/src/os/darwin/src/tdarwin.c @@ -283,7 +283,7 @@ void taosGetSystemLocale() { void tsPrintOsInfo() {} void taosKillSystem() { - tError("function taosKillSystem, exit!"); + tError("function %sKillSystem, exit!", DB_CLIENT_NAME); exit(0); } diff --git a/src/os/linux/src/tlinux.c b/src/os/linux/src/tlinux.c index b81b98a5f7fb9cea96879c570a05fbca8e4e74b5..a54de2532e0c4bad5a35b054ba8a147a2dce6a06 100644 --- a/src/os/linux/src/tlinux.c +++ b/src/os/linux/src/tlinux.c @@ -34,11 +34,11 @@ #include "tutil.h" #include "ttimer.h" -char configDir[TSDB_FILENAME_LEN] = "/etc/taos"; -char tsDirectory[TSDB_FILENAME_LEN] = "/var/lib/taos"; -char dataDir[TSDB_FILENAME_LEN] = "/var/lib/taos"; -char logDir[TSDB_FILENAME_LEN] = "/var/log/taos"; -char scriptDir[TSDB_FILENAME_LEN] = "/etc/taos"; +char configDir[TSDB_FILENAME_LEN] = "/etc/"DB_CLIENT_NAME; +char tsDirectory[TSDB_FILENAME_LEN] = "/var/lib/"DB_CLIENT_NAME; +char dataDir[TSDB_FILENAME_LEN] = "/var/lib/"DB_CLIENT_NAME; +char logDir[TSDB_FILENAME_LEN] = "/var/log/"DB_CLIENT_NAME; +char scriptDir[TSDB_FILENAME_LEN] = "/etc/"DB_CLIENT_NAME; char osName[] = "Linux"; int64_t str2int64(char *str) { diff --git a/src/os/linux/src/tsystem.c b/src/os/linux/src/tsystem.c index 8cd0e6943616f4ecb1f69ed100ca6535968005ae..45d341ca80a635aca9eca5ce70def2e3f55a413a 100644 --- a/src/os/linux/src/tsystem.c +++ b/src/os/linux/src/tsystem.c @@ -589,7 +589,7 @@ void tsPrintOsInfo() { void taosKillSystem() { // SIGINT - pPrint("taosd will shut down soon"); + pPrint("%s will shut down soon", DB_SERVICE_NAME); kill(tsProcId, 2); } diff --git a/src/os/windows/src/twindows.c b/src/os/windows/src/twindows.c index 30973165dfd03f6179f4fc36a83c4b4a32ed3e55..f7d23110d8b2713feedb8c440f5a351896ddc674 100644 --- a/src/os/windows/src/twindows.c +++ b/src/os/windows/src/twindows.c @@ -32,11 +32,11 @@ #include #include -char configDir[TSDB_FILENAME_LEN] = "C:/TDengine/cfg"; -char tsDirectory[TSDB_FILENAME_LEN] = "C:/TDengine/data"; -char logDir[TSDB_FILENAME_LEN] = "C:/TDengine/log"; -char dataDir[TSDB_FILENAME_LEN] = "C:/TDengine/data"; -char scriptDir[TSDB_FILENAME_LEN] = "C:/TDengine/script"; +char configDir[TSDB_FILENAME_LEN] = "C:/"DB_FULL_NAME"/cfg"; +char tsDirectory[TSDB_FILENAME_LEN] = "C:/"DB_FULL_NAME"/data"; +char logDir[TSDB_FILENAME_LEN] = "C:/"DB_FULL_NAME"/log"; +char dataDir[TSDB_FILENAME_LEN] = "C:/"DB_FULL_NAME"/data"; +char scriptDir[TSDB_FILENAME_LEN] = "C:/"DB_FULL_NAME"/script"; char osName[] = "Windows"; bool taosCheckPthreadValid(pthread_t thread) { diff --git a/src/system/detail/CMakeLists.txt b/src/system/detail/CMakeLists.txt index 249a9eb14897a64340ff8e3ef93fac24938bbfd1..e57a604e4d0f4c9b4e2ff1ccf6ad9ed7fb88ec1d 100644 --- a/src/system/detail/CMakeLists.txt +++ b/src/system/detail/CMakeLists.txt @@ -37,9 +37,9 @@ IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM)) COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/cfg/ COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/log/ COMMAND ${CMAKE_COMMAND} -E make_directory ${TD_TESTS_OUTPUT_DIR}/data/ - COMMAND ${CMAKE_COMMAND} -E echo dataDir ${TD_TESTS_OUTPUT_DIR}/data > ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg - COMMAND ${CMAKE_COMMAND} -E echo logDir ${TD_TESTS_OUTPUT_DIR}/log >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg - COMMAND ${CMAKE_COMMAND} -E echo charset UTF-8 >> ${TD_TESTS_OUTPUT_DIR}/cfg/taos.cfg + COMMAND ${CMAKE_COMMAND} -E echo dataDir ${TD_TESTS_OUTPUT_DIR}/data > ${TD_TESTS_OUTPUT_DIR}/cfg/${DB_CLIENT_NAME}.cfg + COMMAND ${CMAKE_COMMAND} -E echo logDir ${TD_TESTS_OUTPUT_DIR}/log >> ${TD_TESTS_OUTPUT_DIR}/cfg/${DB_CLIENT_NAME}.cfg + COMMAND ${CMAKE_COMMAND} -E echo charset UTF-8 >> ${TD_TESTS_OUTPUT_DIR}/cfg/${DB_CLIENT_NAME}.cfg COMMENT "prepare ${DB_SERVICE_NAME} environment") ADD_CUSTOM_TARGET(${PREPARE_ENV_TARGET} ALL WORKING_DIRECTORY ${TD_EXECUTABLE_OUTPUT_PATH} DEPENDS ${PREPARE_ENV_CMD}) diff --git a/src/system/detail/src/dnodeService.c b/src/system/detail/src/dnodeService.c index 742efb7b6a72856095759d7bf8262f50103185f8..556696ee4c97fae0eeb4de8dbed0b1e767d4d4da 100644 --- a/src/system/detail/src/dnodeService.c +++ b/src/system/detail/src/dnodeService.c @@ -33,13 +33,13 @@ void signal_handler(int signum, siginfo_t *sigInfo, void *context) { return; } syslog(LOG_INFO, "Shut down signal is %d", signum); - syslog(LOG_INFO, "Shutting down TDengine service..."); + syslog(LOG_INFO, "Shutting down "DB_FULL_NAME" service..."); // clean the system. dPrint("shut down signal is %d, sender PID:%d", signum, sigInfo->si_pid); dnodeCleanUpSystem(); // close the syslog - syslog(LOG_INFO, "Shut down TDengine service successfully"); - dPrint("TDengine is shut down!"); + syslog(LOG_INFO, "Shut down "DB_FULL_NAME" service successfully"); + dPrint("%s is shut down!", DB_FULL_NAME); closelog(); exit(EXIT_SUCCESS); } @@ -92,19 +92,19 @@ int main(int argc, char *argv[]) { // sigaction(SIGABRT, &act, NULL); // Open /var/log/syslog file to record information. - openlog("TDengine:", LOG_PID | LOG_CONS | LOG_NDELAY, LOG_LOCAL1); - syslog(LOG_INFO, "Starting TDengine service..."); + openlog(DB_FULL_NAME":", LOG_PID | LOG_CONS | LOG_NDELAY, LOG_LOCAL1); + syslog(LOG_INFO, "Starting "DB_FULL_NAME" service..."); // Initialize the system if (dnodeInitSystem() < 0) { - syslog(LOG_ERR, "Error initialize TDengine system"); + syslog(LOG_ERR, "Error initialize "DB_FULL_NAME" system"); closelog(); dnodeCleanUpSystem(); exit(EXIT_FAILURE); } - syslog(LOG_INFO, "Started TDengine service successfully."); + syslog(LOG_INFO, "Started "DB_FULL_NAME" service successfully."); while (1) { sleep(1000); diff --git a/src/system/detail/src/dnodeSystem.c b/src/system/detail/src/dnodeSystem.c index 49e9a37590996921b1784c56e5edca4246fd2bd0..70f399f73d1c2e4dfe50d284869fd8342daaf509 100644 --- a/src/system/detail/src/dnodeSystem.c +++ b/src/system/detail/src/dnodeSystem.c @@ -119,17 +119,17 @@ int dnodeInitSystem() { if (stat(logDir, &dirstat) < 0) mkdir(logDir, 0755); - sprintf(temp, "%s/taosdlog", logDir); + sprintf(temp, "%s/%slog", logDir, DB_SERVICE_NAME); if (taosInitLog(temp, tsNumOfLogLines, 1) < 0) printf("failed to init log file\n"); if (!tsReadGlobalConfig()) { // TODO : Change this function tsPrintGlobalConfig(); - dError("TDengine read global config failed"); + dError("%s read global config failed", DB_FULL_NAME); return -1; } if (taosCreateTierDirectory() != 0) { - dError("TDengine init tier directory failed"); + dError("%s init tier directory failed", DB_FULL_NAME); return -1; } @@ -145,7 +145,7 @@ int dnodeInitSystem() { dnodeInitModules(); pthread_mutex_init(&dmutex, NULL); - dPrint("starting to initialize TDengine ..."); + dPrint("starting to initialize %s ...", DB_FULL_NAME); vnodeInitQHandle(); if (dnodeInitSystemSpec() < 0) { @@ -155,14 +155,14 @@ int dnodeInitSystem() { for (int mod = 0; mod < TSDB_MOD_MAX; ++mod) { if (tsModule[mod].num != 0 && tsModule[mod].initFp) { if ((*tsModule[mod].initFp)() != 0) { - dError("TDengine initialization failed"); + dError("%s initialization failed", DB_FULL_NAME); return -1; } } } if (vnodeInitSystem() != 0) { - dError("TDengine vnodes initialization failed"); + dError("%s vnodes initialization failed", DB_FULL_NAME); return -1; } @@ -170,7 +170,7 @@ int dnodeInitSystem() { dnodeStartModuleSpec(); - dPrint("TDengine is initialized successfully"); + dPrint("%s is initialized successfully", DB_FULL_NAME); return 0; } diff --git a/src/system/detail/src/mgmtSystem.c b/src/system/detail/src/mgmtSystem.c index 375e100a83668f0288fb25fc05f689b3e52b0c91..37b9164a9ea22201cf4e6f2e9dbb0bb97d5331f0 100644 --- a/src/system/detail/src/mgmtSystem.c +++ b/src/system/detail/src/mgmtSystem.c @@ -68,7 +68,7 @@ void mgmtCleanUpSystem() { } int mgmtStartSystem() { - mPrint("starting to initialize TDengine mgmt ..."); + mPrint("starting to initialize database mgmt ..."); struct stat dirstat; if (stat(mgmtDirectory, &dirstat) < 0) { @@ -147,7 +147,7 @@ int mgmtStartSystem() { mgmtStartMgmtTimer(); - mPrint("TDengine mgmt is initialized successfully"); + mPrint("database mgmt is initialized successfully"); return 0; } diff --git a/src/system/lite/src/mgmtAcct.spec.c b/src/system/lite/src/mgmtAcct.spec.c index 81f83df98858055cde7da09e07edb077ab8f0014..2dae9b43ab56d38d43e0dd6ee3199342eb44153a 100644 --- a/src/system/lite/src/mgmtAcct.spec.c +++ b/src/system/lite/src/mgmtAcct.spec.c @@ -59,7 +59,7 @@ void mgmtCheckAcct() { pAcct->acctId = 0; strcpy(pAcct->user, "root"); - mgmtCreateUser(pAcct, "root", "taosdata"); + mgmtCreateUser(pAcct, "root", DB_COMPANY); mgmtCreateUser(pAcct, "monitor", tsInternalPass); mgmtCreateUser(pAcct, "_root", tsInternalPass); } diff --git a/src/util/src/tglobalcfg.c b/src/util/src/tglobalcfg.c index 45efcad56394b1507c60d383a60199d0b96afb02..84b7e67c662da34b87a810897a5e3846c29981b8 100644 --- a/src/util/src/tglobalcfg.c +++ b/src/util/src/tglobalcfg.c @@ -119,7 +119,7 @@ char tsMgmtZone[16] = "rzone"; char tsLocalIp[TSDB_IPv4ADDR_LEN] = {0}; char tsDefaultDB[TSDB_DB_NAME_LEN] = {0}; char tsDefaultUser[64] = "root"; -char tsDefaultPass[64] = "taosdata"; +char tsDefaultPass[64] = DB_COMPANY; int tsMaxMeterConnections = 10000; int tsMaxMgmtConnections = 2000; int tsMaxVnodeConnections = 10000; @@ -863,13 +863,13 @@ void tsReadGlobalLogConfig() { if (full_path.we_wordv != NULL && full_path.we_wordv[0] != NULL) { strcpy(configDir, full_path.we_wordv[0]); } else { - printf("configDir:%s not there, use default value: /etc/taos", configDir); - strcpy(configDir, "/etc/taos"); + printf("configDir:%s not there, use default value: /etc/%s", configDir, DB_CLIENT_NAME); + sprintf(configDir, "/etc/%s", DB_CLIENT_NAME); } wordfree(&full_path); tsReadLogOption("logDir", logDir); - sprintf(fileName, "%s/taos.cfg", configDir); + sprintf(fileName, "%s/%s.cfg", configDir, DB_CLIENT_NAME); fp = fopen(fileName, "r"); if (fp == NULL) { printf("\noption file:%s not found, all options are set to system default\n", fileName); @@ -909,7 +909,7 @@ bool tsReadGlobalConfig() { int olen, vlen, vlen1; char fileName[128]; - sprintf(fileName, "%s/taos.cfg", configDir); + sprintf(fileName, "%s/%s.cfg", configDir, DB_CLIENT_NAME); fp = fopen(fileName, "r"); if (fp == NULL) { } else { @@ -1061,7 +1061,7 @@ int tsCfgDynamicOptions(char *msg) { } void tsPrintGlobalConfig() { - pPrint(" taos config & system info:"); + pPrint(" %s config & system info:", DB_CLIENT_NAME); pPrint("=================================="); for (int i = 0; i < tsGlobalConfigNum; ++i) { diff --git a/src/util/src/version.c b/src/util/src/version.c index 265fc7b7dc36ede8806b81eb3bfb1773f97d5840..80a62f453a424fe93074e241392090aa4cb721cc 100644 --- a/src/util/src/version.c +++ b/src/util/src/version.c @@ -1,7 +1,7 @@ char version[64] = "1.6.6.1"; char compatible_version[64] = "1.6.0.0"; -char gitinfo[128] = "0b5b412ef0ae2449ece538601a29b899b2b727b9"; -char gitinfoOfInternal[128] = "8ae0d83a3610b9b4726373dd3073e4a8f444fb26"; -char buildinfo[512] = "Built by root at 2020-03-11 09:08"; +char gitinfo[128] = "feea817446e25ff1ef77cefaeeda08f45564d6bc"; +char gitinfoOfInternal[128] = "5c736133836e7a9f757216539986ddf746439a11"; +char buildinfo[512] = "Built by root at 2020-03-13 16:27"; -void libtaos_1_6_6_1_Linux_x64_beta() {}; +void libtaos_1_6_6_1_Linux_x64() {};