aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-03-15 13:36:34 +0100
committerGitHub Enterprise <[email protected]>2024-03-15 13:36:34 +0100
commit56150a9449736934b96738320706ebbea3503735 (patch)
tree8e70cab890e2fa761ec662e9bcc0f4c1d871957e /src
parentremove vcpkg integrate install from windows setup (diff)
downloadzen-56150a9449736934b96738320706ebbea3503735.tar.xz
zen-56150a9449736934b96738320706ebbea3503735.zip
make sure zenserver reacts and exist on SIGTERM signal (#8)
* make sure zenserver reacts and exist on SIGTERM signal * add zen tag to all runners * temp disable mac codesigning
Diffstat (limited to 'src')
-rw-r--r--src/zenserver/main.cpp1
-rw-r--r--src/zenserver/zenserver.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index 4a5b98e8e..01e142801 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -325,6 +325,7 @@ main(int argc, char* argv[])
}
signal(SIGINT, utils::SignalCallbackHandler);
+ signal(SIGTERM, utils::SignalCallbackHandler);
try
{
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index 6b0760343..d8176678d 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -847,6 +847,12 @@ ZenServer::CheckSigInt()
RequestExit(128 + SIGINT);
return;
}
+ if (utils::SignalCounter[SIGTERM] > 0)
+ {
+ ZEN_INFO("SIGTERM triggered for process {}, exiting", zen::GetCurrentProcessId());
+ RequestExit(128 + SIGTERM);
+ return;
+ }
EnqueueSigIntTimer();
}