diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-01-26 09:50:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-01-26 09:50:37 +0000 |
commit | ba007d1a80d1d376712d362881b17d64b36898d8 (patch) | |
tree | 60a19634db750591788057ae137b766aa4f034d0 /src/arm/gnunet-arm.c | |
parent | deec9d09189a4e2a2fd52468e9905dcf1b8d023d (diff) | |
download | gnunet-ba007d1a80d1d376712d362881b17d64b36898d8.tar.gz gnunet-ba007d1a80d1d376712d362881b17d64b36898d8.zip |
LRN: Here's a patch. See if it doesn't break anything for you.
Arm service is started with -c <configname> only when the process that
runs arm service has "[arm]/CONFIG" defined in the configuration used
to run arm service (usually - process' own configuration).
Since default [arm] config has no CONFIG defined anymore (thanks to
your r25908), we need to add this code to put the config file that was
passed to gnunet-arm tool via -c as "[arm]/CONFIG" for arm service to
receive it.
Otherwise arm service is run without config and reads default config
(~/.gnunet/gnunet.conf) instead, which is clearly not what we need.
Diffstat (limited to 'src/arm/gnunet-arm.c')
-rw-r--r-- | src/arm/gnunet-arm.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index ca4193837..1b17e2dfe 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c | |||
@@ -291,6 +291,7 @@ static void | |||
291 | run (void *cls, char *const *args, const char *cfgfile, | 291 | run (void *cls, char *const *args, const char *cfgfile, |
292 | const struct GNUNET_CONFIGURATION_Handle *c) | 292 | const struct GNUNET_CONFIGURATION_Handle *c) |
293 | { | 293 | { |
294 | char *armconfig; | ||
294 | cfg = c; | 295 | cfg = c; |
295 | config_file = cfgfile; | 296 | config_file = cfgfile; |
296 | if (GNUNET_CONFIGURATION_get_value_string | 297 | if (GNUNET_CONFIGURATION_get_value_string |
@@ -300,6 +301,18 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
300 | "PATHS", "SERVICEHOME"); | 301 | "PATHS", "SERVICEHOME"); |
301 | return; | 302 | return; |
302 | } | 303 | } |
304 | if (NULL != cfgfile) | ||
305 | { | ||
306 | if (GNUNET_OK != | ||
307 | GNUNET_CONFIGURATION_get_value_filename (cfg, "arm", "CONFIG", | ||
308 | &armconfig)) | ||
309 | { | ||
310 | GNUNET_CONFIGURATION_set_value_string (cfg, "arm", "CONFIG", | ||
311 | cfgfile); | ||
312 | } | ||
313 | else | ||
314 | GNUNET_free (armconfig); | ||
315 | } | ||
303 | if (NULL == (h = GNUNET_ARM_connect (cfg, NULL))) | 316 | if (NULL == (h = GNUNET_ARM_connect (cfg, NULL))) |
304 | { | 317 | { |
305 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 318 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |