]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - command.c
com_term(): Ignore SIGTERM.
[paraslash.git] / command.c
index a0102eebe42db14df8bf9893efec500fc56bf6f1..00d2c5a61ada8fdcedfad2989e43844265ca46d5 100644 (file)
--- 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;
 }