Author: mattm
Date: 2017-08-12 11:31:08 +0200 (Sat, 12 Aug 2017)
New Revision: 29338

Modified:
   trunk/gvm/ChangeLog
   trunk/gvm/src/gvmd.c
Log:
        Simply ignore SIGHUP, now that NVTs are automatically updated.

        * src/gvmd.c (sighup_update_nvt_cache): Remove.
        (update_in_progress): Adjust doc.
        (handle_sighup_update): Remove.
        (serve_and_schedule): Remove SIGHUP checks.
        (main): Set SIGHUP to SIG_IGN.

Modified: trunk/gvm/ChangeLog
===================================================================
--- trunk/gvm/ChangeLog 2017-08-11 14:28:53 UTC (rev 29337)
+++ trunk/gvm/ChangeLog 2017-08-12 09:31:08 UTC (rev 29338)
@@ -1,5 +1,15 @@
 2017-08-10  Matthew Mundell <matthew.mund...@greenbone.net>
 
+       Simply ignore SIGHUP, now that NVTs are automatically updated.
+
+       * src/gvmd.c (sighup_update_nvt_cache): Remove.
+       (update_in_progress): Adjust doc.
+       (handle_sighup_update): Remove.
+       (serve_and_schedule): Remove SIGHUP checks.
+       (main): Set SIGHUP to SIG_IGN.
+
+2017-08-10  Matthew Mundell <matthew.mund...@greenbone.net>
+
        * src/gvmd.c (serve_and_schedule): Separate the sync calls out from
        manage_schedule, with a separate "last time" counter.  This prevents
        the sync checks from happening repeatedly when other parts of

Modified: trunk/gvm/src/gvmd.c
===================================================================
--- trunk/gvm/src/gvmd.c        2017-08-11 14:28:53 UTC (rev 29337)
+++ trunk/gvm/src/gvmd.c        2017-08-12 09:31:08 UTC (rev 29338)
@@ -252,11 +252,6 @@
 volatile int termination_signal = 0;
 
 /**
- * @brief Flag for SIGHUP handler.
- */
-volatile int sighup_update_nvt_cache = 0;
-
-/**
  * @brief The address of the Scanner.
  */
 static gchar **disabled_commands = NULL;
@@ -296,7 +291,7 @@
 gchar *dh_params_option = NULL;
 
 /**
- * @brief Whether a SIGHUP initiated NVT update is in progress.
+ * @brief Whether an NVT update is in progress.
  */
 int update_in_progress = 0;
 
@@ -880,18 +875,6 @@
 }
 
 /**
- * @brief Handle a SIGHUP signal by updating the NVT cache.
- *
- * @param[in]  signal  The signal that caused this function to run.
- */
-void
-handle_sighup_update (int signal)
-{
-  /* Queue the update of the NVT cache. */
-  sighup_update_nvt_cache = 1;
-}
-
-/**
  * @brief Handle a SIGSEGV signal.
  *
  * @param[in]  given_signal  The signal that caused this function to run.
@@ -1035,7 +1018,7 @@
   setup_signal_handler (SIGTERM, handle_termination_signal, 0);
   setup_signal_handler (SIGABRT, handle_sigabrt, 1);
   setup_signal_handler (SIGINT, handle_termination_signal, 0);
-  setup_signal_handler (SIGHUP, handle_termination_signal, 0);
+  setup_signal_handler (SIGHUP, SIG_IGN, 0);
   setup_signal_handler (SIGQUIT, handle_termination_signal, 0);
   setup_signal_handler (SIGSEGV, handle_sigsegv, 1);
   setup_signal_handler (SIGCHLD, SIG_IGN, 0);
@@ -1252,13 +1235,6 @@
           raise (termination_signal);
         }
 
-      if (sighup_update_nvt_cache)
-        {
-          g_debug ("Received %s signal.\n", sys_siglist[SIGHUP]);
-          sighup_update_nvt_cache = 0;
-          fork_update_nvt_cache ();
-        }
-
       if ((time (NULL) - last_schedule_time) >= SCHEDULE_PERIOD)
         switch (manage_schedule (fork_connection_for_scheduler,
                                  scheduling_enabled,
@@ -1349,13 +1325,6 @@
           pthread_sigmask (SIG_SETMASK, sigmask_normal, NULL);
           raise (termination_signal);
         }
-
-      if (sighup_update_nvt_cache)
-        {
-          g_debug ("Received %s signal.\n", sys_siglist[SIGHUP]);
-          sighup_update_nvt_cache = 0;
-          fork_update_nvt_cache ();
-        }
     }
 }
 
@@ -2317,7 +2286,7 @@
   setup_signal_handler (SIGTERM, handle_termination_signal, 0);
   setup_signal_handler (SIGABRT, handle_sigabrt, 1);
   setup_signal_handler (SIGINT, handle_termination_signal, 0);
-  setup_signal_handler (SIGHUP, handle_sighup_update, 0);
+  setup_signal_handler (SIGHUP, SIG_IGN, 0);
   setup_signal_handler (SIGQUIT, handle_termination_signal, 0);
   setup_signal_handler (SIGSEGV, handle_sigsegv, 1);
   setup_signal_handler_info (SIGCHLD, handle_sigchld, 0);

_______________________________________________
Openvas-commits mailing list
Openvas-commits@wald.intevation.org
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-commits

Reply via email to