Skip to content

Commit 41f7713

Browse files
EZForevertybalex
authored andcommitted
server : stop gracefully on SIGTERM (ggml-org#6348)
1 parent 2e488cd commit 41f7713

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/server/server.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3579,6 +3579,7 @@ int main(int argc, char ** argv) {
35793579
sigemptyset (&sigint_action.sa_mask);
35803580
sigint_action.sa_flags = 0;
35813581
sigaction(SIGINT, &sigint_action, NULL);
3582+
sigaction(SIGTERM, &sigint_action, NULL);
35823583
#elif defined (_WIN32)
35833584
auto console_ctrl_handler = +[](DWORD ctrl_type) -> BOOL {
35843585
return (ctrl_type == CTRL_C_EVENT) ? (signal_handler(SIGINT), true) : false;

0 commit comments

Comments
 (0)