gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10536 - in gnunet: contrib src/arm


From: gnunet
Subject: [GNUnet-SVN] r10536 - in gnunet: contrib src/arm
Date: Wed, 10 Mar 2010 15:26:14 +0100

Author: grothoff
Date: 2010-03-10 15:26:14 +0100 (Wed, 10 Mar 2010)
New Revision: 10536

Modified:
   gnunet/contrib/defaults.conf
   gnunet/src/arm/gnunet-service-arm.c
Log:
support GLOBAL_POSTFIX

Modified: gnunet/contrib/defaults.conf
===================================================================
--- gnunet/contrib/defaults.conf        2010-03-10 13:53:42 UTC (rev 10535)
+++ gnunet/contrib/defaults.conf        2010-03-10 14:26:14 UTC (rev 10536)
@@ -32,6 +32,7 @@
 ACCEPT_FROM6 = ::1;
 ALLOW_SHUTDOWN = YES
 DEFAULTSERVICES = resolver transport core topology hostlist
+GLOBAL_POSTFIX = -l $SERVICEHOME/{}-logs
 # GLOBAL_PREFIX =
 # USERNAME =
 # MAXBUF =

Modified: gnunet/src/arm/gnunet-service-arm.c
===================================================================
--- gnunet/src/arm/gnunet-service-arm.c 2010-03-10 13:53:42 UTC (rev 10535)
+++ gnunet/src/arm/gnunet-service-arm.c 2010-03-10 14:26:14 UTC (rev 10536)
@@ -142,6 +142,11 @@
 static char *prefix_command;
 
 /**
+ * Option to append to each actual command.
+ */
+static char *final_option;
+
+/**
  * ID of task called whenever we get a SIGCHILD.
  */
 static GNUNET_SCHEDULER_TaskIdentifier child_death_task;
@@ -349,6 +354,7 @@
 start_process (struct ServiceList *sl)
 {
   char *loprefix;
+  char *lopostfix;
   char *options;
   char **argv;
   unsigned int argv_size;
@@ -365,7 +371,23 @@
   if (GNUNET_OK !=
       GNUNET_CONFIGURATION_get_value_string (cfg,
                                             sl->name, "OPTIONS", &options))
-    options = GNUNET_strdup ("");
+    {      
+      options = GNUNET_strdup (lopostfix);
+      /* replace '{}' with service name */
+      if (NULL == strstr (options, "%"))
+       {
+         while (NULL != (optpos = strstr (options, "{}")))
+           {
+             optpos[0] = '%';
+             optpos[1] = 's';
+             GNUNET_asprintf (&optpos,
+                              options,
+                              sl->name);
+             GNUNET_free (options);
+             options = optpos;
+           }
+       }
+    }
   use_debug = GNUNET_CONFIGURATION_get_value_yesno (cfg, sl->name, "DEBUG");
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Starting service `%s'\n"), sl->name);
@@ -1011,6 +1033,12 @@
                                             "GLOBAL_PREFIX",
                                             &prefix_command))
     prefix_command = GNUNET_strdup ("");
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_string (cfg,
+                                            "ARM",
+                                            "GLOBAL_POSTFIX",
+                                            &final_option))
+    final_option = GNUNET_strdup ("");
   /* start default services... */
   if (GNUNET_OK ==
       GNUNET_CONFIGURATION_get_value_string (cfg,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]