From de5d65030ce984b0cee447b3e87c514ee2a40e7c Mon Sep 17 00:00:00 2001 From: Simon Sundberg Date: Mon, 31 Jan 2022 18:47:08 +0100 Subject: [PATCH] pping: Add graceful shutdown on SIGTERM Also intercept SIGTERM (in addition the the previously intercepted SIGINT) and perform graceful shutdown. Perhaps it also makes sense to perform graceful shutdown on some additional signals, like SIGHUP and SIGQUIT? Signed-off-by: Simon Sundberg --- pping/pping.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pping/pping.c b/pping/pping.c index 63f2d57..99445a9 100644 --- a/pping/pping.c +++ b/pping/pping.c @@ -1024,6 +1024,7 @@ int main(int argc, char *argv[]) // Allow program to perform cleanup on Ctrl-C signal(SIGINT, abort_program); + signal(SIGTERM, abort_program); // Main loop while (keep_running) {