-removing dead options
[oweals/gnunet.git] / src / experimentation / gnunet-daemon-experimentation.c
index 824eab5804c18a9afce8d3dd8d0f293c946cf1b1..085dd14b171fd3cdcc4707191aeddc65ecba29fc 100644 (file)
 #include "gnunet_statistics_service.h"
 #include "gnunet-daemon-experimentation.h"
 
+
+/**
+ * Statistics handle shared between components
+ */
 struct GNUNET_STATISTICS_Handle *GSE_stats;
 
+
+/**
+ * Configuration handle shared between components
+ */
 struct GNUNET_CONFIGURATION_Handle *GSE_cfg;
 
+
 /**
- * Task run during shutdown.
+ * Task run during shutdown to stop all submodules of the experimentation daemon.
  *
  * @param cls unused
  * @param tc unused
@@ -45,12 +54,15 @@ static void
 shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Experimentation daemon shutting down ...\n"));
+
+  GNUNET_EXPERIMENTATION_scheduler_stop ();
   GNUNET_EXPERIMENTATION_nodes_stop ();
+  GNUNET_EXPERIMENTATION_experiments_stop ();
+  GNUNET_EXPERIMENTATION_storage_stop ();
   GNUNET_EXPERIMENTATION_capabilities_stop ();
 }
 
 
-
 /**
  * Function starting all submodules of the experimentation daemon.
  *
@@ -73,12 +85,18 @@ run (void *cls, char *const *args, const char *cfgfile,
                return;
        }
 
-       GNUNET_EXPERIMENTATION_capabilities_start();
+       GNUNET_EXPERIMENTATION_capabilities_start ();
+       GNUNET_EXPERIMENTATION_storage_start ();
+       if (GNUNET_SYSERR == GNUNET_EXPERIMENTATION_experiments_start ())
+       {
+         GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
+         return;
+       }
        GNUNET_EXPERIMENTATION_nodes_start ();
+  GNUNET_EXPERIMENTATION_scheduler_start ();
 
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
                                 NULL);
-
 }