diff options
author | xrs <xrs@mail36.net> | 2018-06-23 16:58:42 +0200 |
---|---|---|
committer | xrs <xrs@mail36.net> | 2018-06-23 16:58:42 +0200 |
commit | 99c6e18e63181d8759ecbb398d58019a55d3ce6f (patch) | |
tree | cf925bf99a6fbe60dbec8ead7248bc59a0c8cce6 /src/arm | |
parent | b993ca621717d0a9958b4138a32fb1e3cef7f54c (diff) | |
parent | c293f84ea192f361baf720a3979589c0e0881abc (diff) | |
download | gnunet-99c6e18e63181d8759ecbb398d58019a55d3ce6f.tar.gz gnunet-99c6e18e63181d8759ecbb398d58019a55d3ce6f.zip |
Merge branch 'master' of ssh://gnunet.org/gnunet
Diffstat (limited to 'src/arm')
-rw-r--r-- | src/arm/arm.conf.in | 6 | ||||
-rw-r--r-- | src/arm/gnunet-service-arm.c | 44 | ||||
-rw-r--r-- | src/arm/test_arm_api_data.conf | 14 |
3 files changed, 34 insertions, 30 deletions
diff --git a/src/arm/arm.conf.in b/src/arm/arm.conf.in index 38cf4599c..64ae35786 100644 --- a/src/arm/arm.conf.in +++ b/src/arm/arm.conf.in | |||
@@ -22,9 +22,9 @@ GLOBAL_PREFIX = @MONKEYPREFIX@ | |||
22 | # system-level services (and we'll expect a second ARM to be | 22 | # system-level services (and we'll expect a second ARM to be |
23 | # run per-user to run user-level services). Note that in this | 23 | # run per-user to run user-level services). Note that in this |
24 | # case you must have manually created a different configuration | 24 | # case you must have manually created a different configuration |
25 | # file with the user where at least this and the USER_ONLY | 25 | # file with the user where at least this and the START_USER_SERVICES |
26 | # options differ. | 26 | # options differ. |
27 | # SYSTEM_ONLY = YES | 27 | # START_SYSTEM_SERVICES = YES |
28 | 28 | ||
29 | # If set to YES, ARM will only start services that are marked as | 29 | # If set to YES, ARM will only start services that are marked as |
30 | # per-user services (and we'll expect a system user to run ARM to | 30 | # per-user services (and we'll expect a system user to run ARM to |
@@ -39,7 +39,7 @@ GLOBAL_PREFIX = @MONKEYPREFIX@ | |||
39 | # USER ARM instances to some free port (counting down from 2085 should | 39 | # USER ARM instances to some free port (counting down from 2085 should |
40 | # be sane). | 40 | # be sane). |
41 | # | 41 | # |
42 | # USER_ONLY = YES | 42 | # START_USER_SERVICES = YES |
43 | 43 | ||
44 | # File where we should log per-service resource consumption on exit. | 44 | # File where we should log per-service resource consumption on exit. |
45 | # RESOURCE_DIAGNOSTICS = resource.log | 45 | # RESOURCE_DIAGNOSTICS = resource.log |
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index b56c9c0a8..a6dccf3de 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -235,6 +235,11 @@ static struct GNUNET_DISK_PipeHandle *sigpipe; | |||
235 | static int in_shutdown; | 235 | static int in_shutdown; |
236 | 236 | ||
237 | /** | 237 | /** |
238 | * Return value from main | ||
239 | */ | ||
240 | static int global_ret; | ||
241 | |||
242 | /** | ||
238 | * Are we starting user services? | 243 | * Are we starting user services? |
239 | */ | 244 | */ |
240 | static int start_user = GNUNET_YES; | 245 | static int start_user = GNUNET_YES; |
@@ -505,7 +510,7 @@ get_server_addresses (const char *service_name, | |||
505 | if (GNUNET_YES == | 510 | if (GNUNET_YES == |
506 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | 511 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
507 | service_name, | 512 | service_name, |
508 | "AUTOSTART")) | 513 | "START_ON_DEMAND")) |
509 | LOG (GNUNET_ERROR_TYPE_ERROR, | 514 | LOG (GNUNET_ERROR_TYPE_ERROR, |
510 | _("Have neither PORT nor UNIXPATH for service `%s', but one is required\n"), | 515 | _("Have neither PORT nor UNIXPATH for service `%s', but one is required\n"), |
511 | service_name); | 516 | service_name); |
@@ -1985,11 +1990,11 @@ setup_service (void *cls, | |||
1985 | if ((GNUNET_YES == | 1990 | if ((GNUNET_YES == |
1986 | GNUNET_CONFIGURATION_have_value (cfg, | 1991 | GNUNET_CONFIGURATION_have_value (cfg, |
1987 | section, | 1992 | section, |
1988 | "USER_SERVICE")) && | 1993 | "RUN_PER_USER")) && |
1989 | (GNUNET_YES == | 1994 | (GNUNET_YES == |
1990 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | 1995 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
1991 | section, | 1996 | section, |
1992 | "USER_SERVICE"))) | 1997 | "RUN_PER_USER"))) |
1993 | { | 1998 | { |
1994 | if (GNUNET_NO == start_user) | 1999 | if (GNUNET_NO == start_user) |
1995 | { | 2000 | { |
@@ -2071,7 +2076,7 @@ setup_service (void *cls, | |||
2071 | if (GNUNET_YES != | 2076 | if (GNUNET_YES != |
2072 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | 2077 | GNUNET_CONFIGURATION_get_value_yesno (cfg, |
2073 | section, | 2078 | section, |
2074 | "AUTOSTART")) | 2079 | "START_ON_DEMAND")) |
2075 | return; | 2080 | return; |
2076 | } | 2081 | } |
2077 | if (0 >= (ret = get_server_addresses (section, | 2082 | if (0 >= (ret = get_server_addresses (section, |
@@ -2219,21 +2224,20 @@ run (void *cls, | |||
2219 | else | 2224 | else |
2220 | final_option = GNUNET_CONFIGURATION_expand_dollar (cfg, | 2225 | final_option = GNUNET_CONFIGURATION_expand_dollar (cfg, |
2221 | final_option); | 2226 | final_option); |
2222 | if (GNUNET_YES == | 2227 | start_user = GNUNET_CONFIGURATION_get_value_yesno (cfg, |
2223 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | ||
2224 | "ARM", | 2228 | "ARM", |
2225 | "USER_ONLY")) | 2229 | "START_USER_SERVICES"); |
2226 | { | 2230 | start_system = GNUNET_CONFIGURATION_get_value_yesno (cfg, |
2227 | GNUNET_break (GNUNET_YES == start_user); | ||
2228 | start_system = GNUNET_NO; | ||
2229 | } | ||
2230 | if (GNUNET_YES == | ||
2231 | GNUNET_CONFIGURATION_get_value_yesno (cfg, | ||
2232 | "ARM", | 2231 | "ARM", |
2233 | "SYSTEM_ONLY")) | 2232 | "START_SYSTEM_SERVICES"); |
2233 | if ( (GNUNET_NO == start_user) && | ||
2234 | (GNUNET_NO == start_system) ) | ||
2234 | { | 2235 | { |
2235 | GNUNET_break (GNUNET_YES == start_system); | 2236 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
2236 | start_user = GNUNET_NO; | 2237 | "Please configure either START_USER_SERVICES or START_SYSTEM_SERVICES or both.\n"); |
2238 | GNUNET_SCHEDULER_shutdown (); | ||
2239 | global_ret = 1; | ||
2240 | return; | ||
2237 | } | 2241 | } |
2238 | GNUNET_CONFIGURATION_iterate_sections (cfg, | 2242 | GNUNET_CONFIGURATION_iterate_sections (cfg, |
2239 | &setup_service, | 2243 | &setup_service, |
@@ -2260,7 +2264,6 @@ int | |||
2260 | main (int argc, | 2264 | main (int argc, |
2261 | char *const *argv) | 2265 | char *const *argv) |
2262 | { | 2266 | { |
2263 | int ret; | ||
2264 | struct GNUNET_SIGNAL_Context *shc_chld; | 2267 | struct GNUNET_SIGNAL_Context *shc_chld; |
2265 | struct GNUNET_MQ_MessageHandler handlers[] = { | 2268 | struct GNUNET_MQ_MessageHandler handlers[] = { |
2266 | GNUNET_MQ_hd_var_size (start, | 2269 | GNUNET_MQ_hd_var_size (start, |
@@ -2294,7 +2297,7 @@ main (int argc, | |||
2294 | shc_chld = | 2297 | shc_chld = |
2295 | GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, | 2298 | GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, |
2296 | &sighandler_child_death); | 2299 | &sighandler_child_death); |
2297 | ret = GNUNET_SERVICE_run_ (argc, | 2300 | if ( GNUNET_OK != GNUNET_SERVICE_run_ (argc, |
2298 | argv, | 2301 | argv, |
2299 | "arm", | 2302 | "arm", |
2300 | GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN, | 2303 | GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN, |
@@ -2302,7 +2305,8 @@ main (int argc, | |||
2302 | &client_connect_cb, | 2305 | &client_connect_cb, |
2303 | &client_disconnect_cb, | 2306 | &client_disconnect_cb, |
2304 | NULL, | 2307 | NULL, |
2305 | handlers); | 2308 | handlers)) |
2309 | global_ret = 2; | ||
2306 | #if HAVE_WAIT4 | 2310 | #if HAVE_WAIT4 |
2307 | if (NULL != wait_file) | 2311 | if (NULL != wait_file) |
2308 | { | 2312 | { |
@@ -2319,7 +2323,7 @@ main (int argc, | |||
2319 | shc_chld = NULL; | 2323 | shc_chld = NULL; |
2320 | GNUNET_DISK_pipe_close (sigpipe); | 2324 | GNUNET_DISK_pipe_close (sigpipe); |
2321 | sigpipe = NULL; | 2325 | sigpipe = NULL; |
2322 | return ret; | 2326 | return global_ret; |
2323 | } | 2327 | } |
2324 | 2328 | ||
2325 | 2329 | ||
diff --git a/src/arm/test_arm_api_data.conf b/src/arm/test_arm_api_data.conf index b032cc95a..276b313b7 100644 --- a/src/arm/test_arm_api_data.conf +++ b/src/arm/test_arm_api_data.conf | |||
@@ -10,12 +10,12 @@ OPTIONS = -L ERROR | |||
10 | #PREFIX = valgrind --tool=memcheck --leak-check=yes | 10 | #PREFIX = valgrind --tool=memcheck --leak-check=yes |
11 | 11 | ||
12 | [resolver] | 12 | [resolver] |
13 | AUTOSTART = YES | 13 | START_ON_DEMAND = YES |
14 | PORT = 23355 | 14 | PORT = 23355 |
15 | # PREFIX = valgrind | 15 | # PREFIX = valgrind |
16 | 16 | ||
17 | [do-nothing] | 17 | [do-nothing] |
18 | AUTOSTART = NO | 18 | START_ON_DEMAND = NO |
19 | PORT = 2223 | 19 | PORT = 2223 |
20 | HOSTNAME = localhost | 20 | HOSTNAME = localhost |
21 | BINARY = /will/be/overwritten/by/test_exponential_backoff | 21 | BINARY = /will/be/overwritten/by/test_exponential_backoff |
@@ -23,16 +23,16 @@ ACCEPT_FROM = 127.0.0.1; | |||
23 | ACCEPT_FROM6 = ::1; | 23 | ACCEPT_FROM6 = ::1; |
24 | 24 | ||
25 | [statistics] | 25 | [statistics] |
26 | AUTOSTART = YES | 26 | START_ON_DEMAND = YES |
27 | 27 | ||
28 | [core] | 28 | [core] |
29 | AUTOSTART = NO | 29 | START_ON_DEMAND = NO |
30 | 30 | ||
31 | [transport] | 31 | [transport] |
32 | AUTOSTART = NO | 32 | START_ON_DEMAND = NO |
33 | 33 | ||
34 | [ats] | 34 | [ats] |
35 | AUTOSTART = NO | 35 | START_ON_DEMAND = NO |
36 | 36 | ||
37 | [peerinfo] | 37 | [peerinfo] |
38 | AUTOSTART = NO | 38 | START_ON_DEMAND = NO |