提交 d0534df8 编写于 作者: S Shengliang Guan

TD-1207

上级 1eace47c
......@@ -145,6 +145,8 @@ int32_t main(int32_t argc, char *argv[]) {
syslog(LOG_INFO, "Shut down TDengine service successfully");
dInfo("TDengine is shut down!");
closelog();
tsem_post(&exitSem);
return EXIT_SUCCESS;
}
......@@ -170,4 +172,5 @@ static void sigintHandler(int32_t signum) {
// inform main thread to exit
tsem_post(&exitSem);
tsem_wait(&exitSem);
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ extern "C" {
#endif
#ifndef SIGHUP
#define SIGHUP 1234
#define SIGHUP 1230
#endif
#ifndef SIGCHLD
......
......@@ -16,18 +16,25 @@
#define _DEFAULT_SOURCE
#include "os.h"
#include <signal.h>
#include <windows.h>
void taosSetSignal(int32_t signum, FSignalHandler sigfp) {
if (signum == SIGUSR1) return;
signal(signum, sigfp);
// SIGHUP doesn't exist in windows, we handle it in the way of ctrlhandler
if (signum == SIGHUP) {
SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigfp, TRUE);
} else {
signal(signum, sigfp);
}
}
void taosIgnSignal(int32_t signum) {
if (signum == SIGUSR1) return;
if (signum == SIGUSR1 || signum == SIGHUP) return;
signal(signum, SIG_IGN);
}
void taosDflSignal(int32_t signum) {
if (signum == SIGUSR1) return;
if (signum == SIGUSR1 || signum == SIGHUP) return;
signal(signum, SIG_DFL);
}
......@@ -54,7 +54,7 @@ if %NODE% == 6 set NODE=7600
if %NODE% == 7 set NODE=7700
if %NODE% == 8 set NODE=7800
set "fqdn="
rem set "fqdn="
for /f "skip=1" %%A in (
'wmic computersystem get caption'
) do if not defined fqdn set "fqdn=%%A"
......
......@@ -37,5 +37,12 @@ if %EXEC_OPTON% == start (
if %EXEC_OPTON% == stop (
rem echo wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" list INSTANCE
wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" call terminate > NUL 2>&1
rem wmic process where "name='taosd.exe' and CommandLine like '%%%NODE_NAME%%%'" call terminate > NUL 2>&1
for /f "tokens=1 skip=1" %%A in (
'wmic process where "name='taosd.exe'" get processId '
) do (
rem echo taskkill /IM %%A
taskkill /IM %%A > NUL 2>&1
)
)
......@@ -33,7 +33,7 @@ if exist %LOG_DIR% rmdir /s/q %LOG_DIR%
if not exist %CFG_DIR% mkdir %CFG_DIR%
if not exist %LOG_DIR% mkdir %LOG_DIR%
set "fqdn="
rem set "fqdn="
for /f "skip=1" %%A in (
'wmic computersystem get caption'
) do if not defined fqdn set "fqdn=%%A"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册