From 4ce5b6570ed83ef2ab5296f369f147593507286b Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 24 Mar 2022 22:06:02 +0100 Subject: [PATCH] com_term(): Ignore SIGTERM. Just to shut up valgrind when the server terminates due to the term command. --- command.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/command.c b/command.c index a0102eeb..00d2c5a6 100644 --- a/command.c +++ b/command.c @@ -630,6 +630,13 @@ EXPORT_SERVER_CMD_HANDLER(ll); static int com_term(__a_unused struct command_context *cc, __a_unused struct lls_parse_result *lpr) { + /* + * The server catches SIGTERM and propagates this signal to all its + * children. We are about to exit anyway, but we'd leak tons of memory + * if being terminated by the signal. So we ignore the signal here and + * terminate via the normal exit path, deallocating all memory. + */ + para_sigaction(SIGTERM, SIG_IGN); kill(getppid(), SIGTERM); return 1; } -- 2.39.2