fixes
authorChristian Grothoff <christian@grothoff.org>
Tue, 11 May 2010 13:43:44 +0000 (13:43 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 11 May 2010 13:43:44 +0000 (13:43 +0000)
contrib/defaults.conf
src/arm/gnunet-service-manager.c
src/hostlist/test_gnunet_daemon_hostlist.c
src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
src/util/service.c
src/util/test_service.c
src/util/test_service_data.conf

index 1760d9a480cc148234b963d5fff1a7ed746d74a2..8aac5049e71e1d06755abcd831ed2f6200eaad38 100644 (file)
@@ -18,7 +18,6 @@ HOME = $SERVICEHOME
 [transport-tcp]
 PORT = 2086
 TIMEOUT = 300000
-ALLOW_SHUTDOWN = NO
 # MAXBUF =
 # DISABLEV6 =
 # BINDTO =
@@ -36,7 +35,6 @@ CONFIG = $DEFAULTCONFIG
 BINARY = gnunet-service-arm
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-ALLOW_SHUTDOWN = YES
 DEFAULTSERVICES = resolver transport core topology hostlist
 # GLOBAL_POSTFIX = -l $SERVICEHOME/{}-logs
 # GLOBAL_PREFIX =
@@ -50,6 +48,7 @@ DEFAULTSERVICES = resolver transport core topology hostlist
 # PREFIX =
 
 [statistics]
+AUTOSTART = YES
 PORT = 2088
 HOSTNAME = localhost
 HOME = $SERVICEHOME
@@ -57,7 +56,6 @@ CONFIG = $DEFAULTCONFIG
 BINARY = gnunet-service-statistics
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-ALLOW_SHUTDOWN = YES
 # USERNAME = 
 # MAXBUF =
 # TIMEOUT =
@@ -68,6 +66,7 @@ ALLOW_SHUTDOWN = YES
 # PREFIX =
 
 [resolver]
+AUTOSTART = YES
 PORT = 2089
 HOSTNAME = localhost
 HOME = $SERVICEHOME
@@ -75,7 +74,6 @@ CONFIG = $DEFAULTCONFIG
 BINARY = gnunet-service-resolver
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-ALLOW_SHUTDOWN = YES
 # USERNAME = 
 # MAXBUF =
 # TIMEOUT =
@@ -86,6 +84,7 @@ ALLOW_SHUTDOWN = YES
 # PREFIX =
 
 [peerinfo]
+AUTOSTART = YES
 PORT = 2090
 HOSTNAME = localhost
 HOME = $SERVICEHOME
@@ -93,7 +92,6 @@ CONFIG = $DEFAULTCONFIG
 BINARY = gnunet-service-peerinfo
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-ALLOW_SHUTDOWN = YES
 # USERNAME = 
 # MAXBUF =
 # TIMEOUT =
@@ -107,6 +105,7 @@ TRUST = $SERVICEHOME/data/credit/
 
 
 [transport]
+AUTOSTART = YES
 PORT = 2091
 HOSTNAME = localhost
 HOME = $SERVICEHOME
@@ -115,7 +114,6 @@ BINARY = gnunet-service-transport
 NEIGHBOUR_LIMIT = 50
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-ALLOW_SHUTDOWN = YES
 PLUGINS = tcp
 # USERNAME = 
 # MAXBUF =
@@ -127,6 +125,7 @@ PLUGINS = tcp
 # PREFIX =
 
 [core]
+AUTOSTART = YES
 PORT = 2092
 HOSTNAME = localhost
 HOME = $SERVICEHOME
@@ -134,7 +133,6 @@ CONFIG = $DEFAULTCONFIG
 BINARY = gnunet-service-core
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-ALLOW_SHUTDOWN = YES
 # quotas are in bytes per second now!
 TOTAL_QUOTA_IN = 65536
 TOTAL_QUOTA_OUT = 65536
@@ -173,6 +171,7 @@ HTTP-PROXY =
 
 
 [datastore]
+AUTOSTART = YES
 PORT = 2093
 HOSTNAME = localhost
 HOME = $SERVICEHOME
@@ -180,7 +179,6 @@ CONFIG = $DEFAULTCONFIG
 BINARY = gnunet-service-datastore
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-ALLOW_SHUTDOWN = YES
 QUOTA = 100000000
 BLOOMFILTER = $SERVICEHOME/fs/bloomfilter
 DATABASE = sqlite
@@ -189,6 +187,7 @@ DATABASE = sqlite
 FILENAME = $SERVICEHOME/datastore/sqlite.db
 
 [fs]
+AUTOSTART = YES
 INDEXDB = $SERVICEHOME/idxinfo.lst
 IDENTITY_DIR = $SERVICEHOME/identities/
 STATE_DIR = $SERVICEHOME/persistence/
@@ -199,6 +198,5 @@ CONFIG = $DEFAULTCONFIG
 BINARY = gnunet-service-fs
 ACCEPT_FROM = 127.0.0.1;
 ACCEPT_FROM6 = ::1;
-ALLOW_SHUTDOWN = YES
 # DEBUG = YES
 
index a5599105097bae50b1ac157169299464c9f579e5..79a5e5043f74511cca21812428703e387c434119 100644 (file)
@@ -730,7 +730,8 @@ checkPortNumberCB (void *cls,
   unsigned int i;
   
   if ( (strcasecmp (section, "arm") == 0) ||
-       (strcasecmp (option, "PORT") != 0) ||
+       (strcasecmp (option, "AUTOSTART") != 0) ||
+       (strcasecmp (value, "YES") != 0) ||
        (isInDefaultList (section) == GNUNET_YES) )
     return;
   if (0 >= (ret = GNUNET_SERVICE_get_server_addresses (section, cfg, &addrs,
index a8f092121626e8697e733a87beda3f86309e95c3..3e179e5d979eb678a771ed53f893904d30f9bfb2 100644 (file)
@@ -48,7 +48,6 @@ struct PeerContext
   struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_TRANSPORT_Handle *th;
   struct GNUNET_MessageHeader *hello;
-  struct GNUNET_ARM_Handle *arm;
 #if START_ARM
   pid_t arm_pid;
 #endif
@@ -145,7 +144,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
                                         "-c", cfgname, NULL);
 #endif
   GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
-  GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
   p->th = GNUNET_TRANSPORT_connect (sched, p->cfg, p, NULL, 
                                    &notify_connect, NULL);
   GNUNET_assert (p->th != NULL);
@@ -174,35 +172,16 @@ waitpid_task (void *cls,
 
 
 static void
-stop_cb (void *cls, 
-        int success)
+stop_arm (struct PeerContext *p)
 {
-  struct PeerContext *p = cls;
-
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             success 
-             ? "ARM stopped core service\n" 
-             : "ARM failed to stop core service\n");
-  GNUNET_ARM_disconnect (p->arm);
-  p->arm = NULL;
-  /* make sure this runs after all other tasks are done */
+             "Asking ARM to stop core service\n");
   GNUNET_SCHEDULER_add_delayed (sched,
                                GNUNET_TIME_UNIT_SECONDS,
                                &waitpid_task, p);
 }
 
 
-static void
-stop_arm (struct PeerContext *p)
-{
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Asking ARM to stop core service\n");
-  p->arm = GNUNET_ARM_connect (p->cfg, sched, NULL);
-  GNUNET_ARM_stop_service (p->arm, "core", GNUNET_TIME_UNIT_SECONDS,
-                          &stop_cb, p);
-}
-
-
 /**
  * Try again to connect to transport service.
  */
index 31aac4bdf3b995547e61e6e2ab7d95a421104717..2a46763bf77e3f0a6686f48199b86a0c80c3077b 100644 (file)
@@ -13,7 +13,7 @@ DEBUG = NO
 
 [arm]
 PORT = 12966
-DEFAULTSERVICES = resolver transport core statistics topology
+DEFAULTSERVICES = hostlist topology
 #GLOBAL_PREFIX = xterm -e gdb -x cmd --args 
 
 [statistics]
@@ -47,4 +47,10 @@ DEBUG = NO
 [topology]
 #DEBUG = YES
 #PREFIX = valgrind --tool=memcheck
-DEBUG = NO
\ No newline at end of file
+DEBUG = NO
+
+[fs]
+AUTOSTART = NO
+
+[datastore]
+AUTOSTART = NO[fs]
index f23488dfdcb3ba063de80322f74a7067cfe76cb3..c256c28297d95e1efda4e3bfd232fb8ab723cf13 100644 (file)
@@ -13,7 +13,7 @@ DEBUG = NO
 
 [arm]
 PORT = 22966
-DEFAULTSERVICES = resolver transport core statistics topology
+DEFAULTSERVICES = hostlist topology
 #GLOBAL_PREFIX = xterm -e gdb -x cmd --args 
 DEBUG = NO
 
@@ -47,3 +47,9 @@ HOSTLISTFILE = hostlists_peer2.file
 #DEBUG = YES
 #PREFIX = valgrind --tool=memcheck
 DEBUG = NO
+
+[fs]
+AUTOSTART = NO
+
+[datastore]
+AUTOSTART = NO
\ No newline at end of file
index 2022395f771435cda3e113d07ecdc574534bbc71..82e7070a10eca8b471bd9869d964eb0503e7fcda 100644 (file)
@@ -510,11 +510,6 @@ struct GNUNET_SERVICE_Context
    */
   int require_found;
 
-  /**
-   * Can clients ask us to initiate a shutdown?
-   */
-  int allow_shutdown;
-
   /**
    * Our options.
    */
@@ -944,7 +939,6 @@ GNUNET_SERVICE_get_server_addresses (const char *serviceName,
  * - TIMEOUT (after how many ms does an inactive service timeout);
  * - MAXBUF (maximum incoming message size supported)
  * - DISABLEV6 (disable support for IPv6, otherwise we use dual-stack)
- * - ALLOW_SHUTDOWN (allow clients to shutdown this service)
  * - BINDTO (hostname or IP address to bind to, otherwise we take everything)
  * - ACCEPT_FROM  (only allow connections from specified IPv4 subnets)
  * - ACCEPT_FROM6 (only allow connections from specified IPv6 subnets)
@@ -995,24 +989,6 @@ setup_service (struct GNUNET_SERVICE_Context *sctx)
     }
   else
     maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE;
-  if (GNUNET_CONFIGURATION_have_value (sctx->cfg,
-                                       sctx->serviceName, "ALLOW_SHUTDOWN"))
-    {
-      if (GNUNET_SYSERR ==
-          (sctx->allow_shutdown =
-           GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName,
-                                                 "ALLOW_SHUTDOWN")))
-       {
-         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                     _("Specified value for `%s' of service `%s' is invalid\n"),
-                     "ALLOW_SHUTDOWN",
-                     sctx->serviceName);
-         return GNUNET_SYSERR;
-       }
-    }
-  else
-    sctx->allow_shutdown = GNUNET_NO;
-
 
   if (GNUNET_CONFIGURATION_have_value (sctx->cfg,
                                        sctx->serviceName, "TOLERANT"))
index c406a0f249797e03dc41cca9da4594b6955aa081..6148fa2cc56cfe1e448a8b681fa5149f7db81c7b 100644 (file)
@@ -206,38 +206,6 @@ check6 ()
 }
 
 
-/**
- * Main method, starts scheduler with task1,
- * checks that "ok" is correct at the end.
- */
-static int
-check6d ()
-{
-  ok = 1;
-  char *const argv[] = {
-    "test_service6",
-    "-c",
-    "test_service_data.conf",
-    "-L",
-#if VERBOSE
-    "DEBUG",
-#else
-    "WARNING",
-#endif
-    "-d",
-    NULL
-  };
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting V6 as daemon\n");
-  GNUNET_assert (GNUNET_OK ==
-                 GNUNET_SERVICE_run (6,
-                                     argv,
-                                     "test_service6",
-                                     GNUNET_SERVICE_OPTION_NONE,
-                                     &runner6, &ok));
-  GNUNET_break (0 == ok);
-  return ok;
-}
-
 
 static void
 start_stop_main (void *cls,
@@ -322,7 +290,6 @@ main (int argc, char *argv[])
     {
       GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (s));
       ret += check6 ();
-      ret += check6d ();        /* with daemonization */
     }
   ret += check_start_stop ();
 
index d3a3e82785737e06f22f24e29aac8b891cf6c298..cff43ccb0d68261f4ac12539b7f47b19f267bdc0 100644 (file)
@@ -10,7 +10,6 @@ REJECT_FROM=1.2.3.0/15;4.5.0.0/8;6.7.8.9/255.255.255.0;
 ACCEPT_FROM6=::1;
 REJECT_FROM6=AB:CD:EF::00;AB:CD::00/40;
 HOSTNAME=localhost
-ALLOW_SHUTDOWN=YES
 
 [test_service6]
 PORT=12435
@@ -23,7 +22,6 @@ REJECT_FROM=1.2.3.0/15;4.5.0.0/8;6.7.8.9/255.255.255.0;
 ACCEPT_FROM6=::1;
 REJECT_FROM6=AB:CD:EF::00;AB:CD::00/40;
 HOSTNAME=::1
-ALLOW_SHUTDOWN=YES
 
 [resolver]
 HOSTNAME=localhost