diff options
Diffstat (limited to 'src/util/service.c')
-rw-r--r-- | src/util/service.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/src/util/service.c b/src/util/service.c index 210074017..e6fec7514 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -999,8 +999,13 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) | |||
999 | GNUNET_CONFIGURATION_get_value_time (sctx->cfg, | 999 | GNUNET_CONFIGURATION_get_value_time (sctx->cfg, |
1000 | sctx->serviceName, | 1000 | sctx->serviceName, |
1001 | "TIMEOUT", &idleout)) | 1001 | "TIMEOUT", &idleout)) |
1002 | return GNUNET_SYSERR; | 1002 | { |
1003 | 1003 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | |
1004 | _("Specified value for `%s' of service `%s' is invalid\n"), | ||
1005 | "TIMEOUT", | ||
1006 | sctx->serviceName); | ||
1007 | return GNUNET_SYSERR; | ||
1008 | } | ||
1004 | sctx->timeout = idleout; | 1009 | sctx->timeout = idleout; |
1005 | } | 1010 | } |
1006 | else | 1011 | else |
@@ -1012,7 +1017,13 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) | |||
1012 | GNUNET_CONFIGURATION_get_value_number (sctx->cfg, | 1017 | GNUNET_CONFIGURATION_get_value_number (sctx->cfg, |
1013 | sctx->serviceName, | 1018 | sctx->serviceName, |
1014 | "MAXBUF", &maxbuf)) | 1019 | "MAXBUF", &maxbuf)) |
1015 | return GNUNET_SYSERR; | 1020 | { |
1021 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
1022 | _("Specified value for `%s' of service `%s' is invalid\n"), | ||
1023 | "MAXBUF", | ||
1024 | sctx->serviceName); | ||
1025 | return GNUNET_SYSERR; | ||
1026 | } | ||
1016 | } | 1027 | } |
1017 | else | 1028 | else |
1018 | maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE; | 1029 | maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE; |
@@ -1023,7 +1034,13 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) | |||
1023 | (sctx->allow_shutdown = | 1034 | (sctx->allow_shutdown = |
1024 | GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName, | 1035 | GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName, |
1025 | "ALLOW_SHUTDOWN"))) | 1036 | "ALLOW_SHUTDOWN"))) |
1026 | return GNUNET_SYSERR; | 1037 | { |
1038 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
1039 | _("Specified value for `%s' of service `%s' is invalid\n"), | ||
1040 | "ALLOW_SHUTDOWN", | ||
1041 | sctx->serviceName); | ||
1042 | return GNUNET_SYSERR; | ||
1043 | } | ||
1027 | } | 1044 | } |
1028 | else | 1045 | else |
1029 | sctx->allow_shutdown = GNUNET_NO; | 1046 | sctx->allow_shutdown = GNUNET_NO; |
@@ -1036,7 +1053,13 @@ setup_service (struct GNUNET_SERVICE_Context *sctx) | |||
1036 | (tolerant = GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, | 1053 | (tolerant = GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, |
1037 | sctx->serviceName, | 1054 | sctx->serviceName, |
1038 | "TOLERANT"))) | 1055 | "TOLERANT"))) |
1039 | return GNUNET_SYSERR; | 1056 | { |
1057 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
1058 | _("Specified value for `%s' of service `%s' is invalid\n"), | ||
1059 | "TOLERANT", | ||
1060 | sctx->serviceName); | ||
1061 | return GNUNET_SYSERR; | ||
1062 | } | ||
1040 | } | 1063 | } |
1041 | else | 1064 | else |
1042 | tolerant = GNUNET_NO; | 1065 | tolerant = GNUNET_NO; |
@@ -1417,17 +1440,17 @@ GNUNET_SERVICE_run (int argc, | |||
1417 | /* setup subsystems */ | 1440 | /* setup subsystems */ |
1418 | if (GNUNET_SYSERR == GNUNET_GETOPT_run (serviceName, service_options, argc, | 1441 | if (GNUNET_SYSERR == GNUNET_GETOPT_run (serviceName, service_options, argc, |
1419 | argv)) | 1442 | argv)) |
1420 | HANDLE_ERROR; | 1443 | goto shutdown; |
1421 | if (GNUNET_OK != GNUNET_log_setup (serviceName, loglev, logfile)) | 1444 | if (GNUNET_OK != GNUNET_log_setup (serviceName, loglev, logfile)) |
1422 | HANDLE_ERROR; | 1445 | HANDLE_ERROR; |
1423 | if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfg_fn)) | 1446 | if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfg_fn)) |
1424 | HANDLE_ERROR; | 1447 | goto shutdown; |
1425 | if (GNUNET_OK != setup_service (&sctx)) | 1448 | if (GNUNET_OK != setup_service (&sctx)) |
1426 | HANDLE_ERROR; | 1449 | goto shutdown; |
1427 | if ( (do_daemonize == 1) && (GNUNET_OK != detach_terminal (&sctx))) | 1450 | if ( (do_daemonize == 1) && (GNUNET_OK != detach_terminal (&sctx))) |
1428 | HANDLE_ERROR; | 1451 | HANDLE_ERROR; |
1429 | if (GNUNET_OK != set_user_id (&sctx)) | 1452 | if (GNUNET_OK != set_user_id (&sctx)) |
1430 | HANDLE_ERROR; | 1453 | goto shutdown; |
1431 | #if DEBUG_SERVICE | 1454 | #if DEBUG_SERVICE |
1432 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1455 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1433 | "Service `%s' runs with configuration from `%s'\n", | 1456 | "Service `%s' runs with configuration from `%s'\n", |