diff options
Diffstat (limited to 'src/arm/gnunet-service-arm.c')
-rw-r--r-- | src/arm/gnunet-service-arm.c | 92 |
1 files changed, 64 insertions, 28 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 5014faa15..82ea8edaa 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -444,15 +444,18 @@ start_process (struct ServiceList *sl, | |||
444 | 444 | ||
445 | /* obtain configuration */ | 445 | /* obtain configuration */ |
446 | if (GNUNET_OK != | 446 | if (GNUNET_OK != |
447 | GNUNET_CONFIGURATION_get_value_string (cfg, sl->name, "PREFIX", | 447 | GNUNET_CONFIGURATION_get_value_string (cfg, |
448 | &loprefix)) | 448 | sl->name, |
449 | "PREFIX", | ||
450 | &loprefix)) | ||
449 | loprefix = GNUNET_strdup (prefix_command); | 451 | loprefix = GNUNET_strdup (prefix_command); |
450 | if (GNUNET_OK != | 452 | if (GNUNET_OK != |
451 | GNUNET_CONFIGURATION_get_value_string (cfg, sl->name, "OPTIONS", | 453 | GNUNET_CONFIGURATION_get_value_string (cfg, |
452 | &options)) | 454 | sl->name, |
455 | "OPTIONS", | ||
456 | &options)) | ||
453 | options = NULL; | 457 | options = NULL; |
454 | else | 458 | |
455 | options = GNUNET_CONFIGURATION_expand_dollar (cfg, options); | ||
456 | { | 459 | { |
457 | char *new_options; | 460 | char *new_options; |
458 | char *optpos; | 461 | char *optpos; |
@@ -488,8 +491,11 @@ start_process (struct ServiceList *sl, | |||
488 | options = fin_options; | 491 | options = fin_options; |
489 | } | 492 | } |
490 | } | 493 | } |
491 | use_debug = GNUNET_CONFIGURATION_get_value_yesno (cfg, sl->name, "DEBUG"); | 494 | options = GNUNET_CONFIGURATION_expand_dollar (cfg, |
492 | 495 | options); | |
496 | use_debug = GNUNET_CONFIGURATION_get_value_yesno (cfg, | ||
497 | sl->name, | ||
498 | "DEBUG"); | ||
493 | { | 499 | { |
494 | const char *service_type = NULL; | 500 | const char *service_type = NULL; |
495 | const char *choices[] = { "GNUNET", "SIMPLE", NULL }; | 501 | const char *choices[] = { "GNUNET", "SIMPLE", NULL }; |
@@ -525,8 +531,11 @@ start_process (struct ServiceList *sl, | |||
525 | sl->proc = | 531 | sl->proc = |
526 | GNUNET_OS_start_process_s (sl->pipe_control, | 532 | GNUNET_OS_start_process_s (sl->pipe_control, |
527 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 533 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
528 | lsocks, loprefix, quotedbinary, | 534 | lsocks, |
529 | options, NULL); | 535 | loprefix, |
536 | quotedbinary, | ||
537 | options, | ||
538 | NULL); | ||
530 | } | 539 | } |
531 | else | 540 | else |
532 | { | 541 | { |
@@ -545,15 +554,23 @@ start_process (struct ServiceList *sl, | |||
545 | sl->proc = | 554 | sl->proc = |
546 | GNUNET_OS_start_process_s (sl->pipe_control, | 555 | GNUNET_OS_start_process_s (sl->pipe_control, |
547 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 556 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
548 | lsocks, loprefix, quotedbinary, "-L", | 557 | lsocks, |
549 | "DEBUG", options, NULL); | 558 | loprefix, |
559 | quotedbinary, | ||
560 | "-L", "DEBUG", | ||
561 | options, | ||
562 | NULL); | ||
550 | else | 563 | else |
551 | sl->proc = | 564 | sl->proc = |
552 | GNUNET_OS_start_process_s (sl->pipe_control, | 565 | GNUNET_OS_start_process_s (sl->pipe_control, |
553 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 566 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
554 | lsocks, loprefix, quotedbinary, "-c", | 567 | lsocks, |
555 | sl->config, "-L", | 568 | loprefix, |
556 | "DEBUG", options, NULL); | 569 | quotedbinary, |
570 | "-c", sl->config, | ||
571 | "-L", "DEBUG", | ||
572 | options, | ||
573 | NULL); | ||
557 | } | 574 | } |
558 | else | 575 | else |
559 | { | 576 | { |
@@ -561,14 +578,21 @@ start_process (struct ServiceList *sl, | |||
561 | sl->proc = | 578 | sl->proc = |
562 | GNUNET_OS_start_process_s (sl->pipe_control, | 579 | GNUNET_OS_start_process_s (sl->pipe_control, |
563 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 580 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
564 | lsocks, loprefix, quotedbinary, | 581 | lsocks, |
565 | options, NULL); | 582 | loprefix, |
583 | quotedbinary, | ||
584 | options, | ||
585 | NULL); | ||
566 | else | 586 | else |
567 | sl->proc = | 587 | sl->proc = |
568 | GNUNET_OS_start_process_s (sl->pipe_control, | 588 | GNUNET_OS_start_process_s (sl->pipe_control, |
569 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 589 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
570 | lsocks, loprefix, quotedbinary, "-c", | 590 | lsocks, |
571 | sl->config, options, NULL); | 591 | loprefix, |
592 | quotedbinary, | ||
593 | "-c", sl->config, | ||
594 | options, | ||
595 | NULL); | ||
572 | } | 596 | } |
573 | } | 597 | } |
574 | GNUNET_free (binary); | 598 | GNUNET_free (binary); |
@@ -1493,7 +1517,7 @@ setup_service (void *cls, | |||
1493 | if (( (GNUNET_OK != | 1517 | if (( (GNUNET_OK != |
1494 | GNUNET_CONFIGURATION_get_value_filename (cfg, section, | 1518 | GNUNET_CONFIGURATION_get_value_filename (cfg, section, |
1495 | "CONFIG", | 1519 | "CONFIG", |
1496 | &config)) && | 1520 | &config)) && |
1497 | (GNUNET_OK != | 1521 | (GNUNET_OK != |
1498 | GNUNET_CONFIGURATION_get_value_filename (cfg, | 1522 | GNUNET_CONFIGURATION_get_value_filename (cfg, |
1499 | "PATHS", | 1523 | "PATHS", |
@@ -1519,8 +1543,12 @@ setup_service (void *cls, | |||
1519 | #if WINDOWS | 1543 | #if WINDOWS |
1520 | sl->pipe_control = GNUNET_YES; | 1544 | sl->pipe_control = GNUNET_YES; |
1521 | #else | 1545 | #else |
1522 | if (GNUNET_CONFIGURATION_have_value (cfg, section, "PIPECONTROL")) | 1546 | if (GNUNET_CONFIGURATION_have_value (cfg, |
1523 | sl->pipe_control = GNUNET_CONFIGURATION_get_value_yesno (cfg, section, "PIPECONTROL"); | 1547 | section, |
1548 | "PIPECONTROL")) | ||
1549 | sl->pipe_control = GNUNET_CONFIGURATION_get_value_yesno (cfg, | ||
1550 | section, | ||
1551 | "PIPECONTROL"); | ||
1524 | #endif | 1552 | #endif |
1525 | GNUNET_CONTAINER_DLL_insert (running_head, | 1553 | GNUNET_CONTAINER_DLL_insert (running_head, |
1526 | running_tail, | 1554 | running_tail, |
@@ -1650,21 +1678,29 @@ run (void *cls, struct GNUNET_SERVER_Handle *serv, | |||
1650 | } | 1678 | } |
1651 | #endif | 1679 | #endif |
1652 | if (GNUNET_OK != | 1680 | if (GNUNET_OK != |
1653 | GNUNET_CONFIGURATION_get_value_string (cfg, "ARM", "GLOBAL_PREFIX", | 1681 | GNUNET_CONFIGURATION_get_value_string (cfg, |
1654 | &prefix_command)) | 1682 | "ARM", |
1683 | "GLOBAL_PREFIX", | ||
1684 | &prefix_command)) | ||
1655 | prefix_command = GNUNET_strdup (""); | 1685 | prefix_command = GNUNET_strdup (""); |
1656 | if (GNUNET_OK != | 1686 | if (GNUNET_OK != |
1657 | GNUNET_CONFIGURATION_get_value_string (cfg, "ARM", "GLOBAL_POSTFIX", | 1687 | GNUNET_CONFIGURATION_get_value_string (cfg, |
1658 | &final_option)) | 1688 | "ARM", |
1689 | "GLOBAL_POSTFIX", | ||
1690 | &final_option)) | ||
1659 | final_option = GNUNET_strdup (""); | 1691 | final_option = GNUNET_strdup (""); |
1660 | if (GNUNET_YES == | 1692 | if (GNUNET_YES == |
1661 | GNUNET_CONFIGURATION_get_value_yesno (cfg, "ARM", "USER_ONLY")) | 1693 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
1694 | "ARM", | ||
1695 | "USER_ONLY")) | ||
1662 | { | 1696 | { |
1663 | GNUNET_break (GNUNET_YES == start_user); | 1697 | GNUNET_break (GNUNET_YES == start_user); |
1664 | start_system = GNUNET_NO; | 1698 | start_system = GNUNET_NO; |
1665 | } | 1699 | } |
1666 | if (GNUNET_YES == | 1700 | if (GNUNET_YES == |
1667 | GNUNET_CONFIGURATION_get_value_yesno (cfg, "ARM", "SYSTEM_ONLY")) | 1701 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
1702 | "ARM", | ||
1703 | "SYSTEM_ONLY")) | ||
1668 | { | 1704 | { |
1669 | GNUNET_break (GNUNET_YES == start_system); | 1705 | GNUNET_break (GNUNET_YES == start_system); |
1670 | start_user = GNUNET_NO; | 1706 | start_user = GNUNET_NO; |