From 6c67c6fc67445314b9d2d0b5096072e9bba19394 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Sat, 9 Sep 2023 00:29:43 +0800 Subject: [PATCH] process SIGTERM signal --- server/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/main.cpp b/server/main.cpp index f0d0ce1b..737f3559 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -420,6 +420,12 @@ int start_main(int argc,char *argv[]) { sem.post(); }); // 设置退出信号 + signal(SIGTERM,[](int) { + WarnL << "SIGINT:exit"; + signal(SIGTERM, SIG_IGN); + sem.post(); + }); + #if !defined(_WIN32) signal(SIGHUP, [](int) { mediakit::loadIniConfig(g_ini_file.data()); }); #endif