aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-11 13:43:44 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-11 13:43:44 +0000
commitbed8e0d389aacc368b3dd9704d355b284236fea3 (patch)
tree8fb1826c6f7b09fe09f4a0c456ea58699746db3b
parentbd3ab1e9cafa730d9eaf2d1113467ea89de1916b (diff)
downloadgnunet-bed8e0d389aacc368b3dd9704d355b284236fea3.tar.gz
gnunet-bed8e0d389aacc368b3dd9704d355b284236fea3.zip
fixes
-rw-r--r--contrib/defaults.conf16
-rw-r--r--src/arm/gnunet-service-manager.c3
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist.c25
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_peer1.conf10
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_peer2.conf8
-rw-r--r--src/util/service.c24
-rw-r--r--src/util/test_service.c33
-rw-r--r--src/util/test_service_data.conf2
8 files changed, 26 insertions, 95 deletions
diff --git a/contrib/defaults.conf b/contrib/defaults.conf
index 1760d9a48..8aac5049e 100644
--- a/contrib/defaults.conf
+++ b/contrib/defaults.conf
@@ -18,7 +18,6 @@ HOME = $SERVICEHOME
18[transport-tcp] 18[transport-tcp]
19PORT = 2086 19PORT = 2086
20TIMEOUT = 300000 20TIMEOUT = 300000
21ALLOW_SHUTDOWN = NO
22# MAXBUF = 21# MAXBUF =
23# DISABLEV6 = 22# DISABLEV6 =
24# BINDTO = 23# BINDTO =
@@ -36,7 +35,6 @@ CONFIG = $DEFAULTCONFIG
36BINARY = gnunet-service-arm 35BINARY = gnunet-service-arm
37ACCEPT_FROM = 127.0.0.1; 36ACCEPT_FROM = 127.0.0.1;
38ACCEPT_FROM6 = ::1; 37ACCEPT_FROM6 = ::1;
39ALLOW_SHUTDOWN = YES
40DEFAULTSERVICES = resolver transport core topology hostlist 38DEFAULTSERVICES = resolver transport core topology hostlist
41# GLOBAL_POSTFIX = -l $SERVICEHOME/{}-logs 39# GLOBAL_POSTFIX = -l $SERVICEHOME/{}-logs
42# GLOBAL_PREFIX = 40# GLOBAL_PREFIX =
@@ -50,6 +48,7 @@ DEFAULTSERVICES = resolver transport core topology hostlist
50# PREFIX = 48# PREFIX =
51 49
52[statistics] 50[statistics]
51AUTOSTART = YES
53PORT = 2088 52PORT = 2088
54HOSTNAME = localhost 53HOSTNAME = localhost
55HOME = $SERVICEHOME 54HOME = $SERVICEHOME
@@ -57,7 +56,6 @@ CONFIG = $DEFAULTCONFIG
57BINARY = gnunet-service-statistics 56BINARY = gnunet-service-statistics
58ACCEPT_FROM = 127.0.0.1; 57ACCEPT_FROM = 127.0.0.1;
59ACCEPT_FROM6 = ::1; 58ACCEPT_FROM6 = ::1;
60ALLOW_SHUTDOWN = YES
61# USERNAME = 59# USERNAME =
62# MAXBUF = 60# MAXBUF =
63# TIMEOUT = 61# TIMEOUT =
@@ -68,6 +66,7 @@ ALLOW_SHUTDOWN = YES
68# PREFIX = 66# PREFIX =
69 67
70[resolver] 68[resolver]
69AUTOSTART = YES
71PORT = 2089 70PORT = 2089
72HOSTNAME = localhost 71HOSTNAME = localhost
73HOME = $SERVICEHOME 72HOME = $SERVICEHOME
@@ -75,7 +74,6 @@ CONFIG = $DEFAULTCONFIG
75BINARY = gnunet-service-resolver 74BINARY = gnunet-service-resolver
76ACCEPT_FROM = 127.0.0.1; 75ACCEPT_FROM = 127.0.0.1;
77ACCEPT_FROM6 = ::1; 76ACCEPT_FROM6 = ::1;
78ALLOW_SHUTDOWN = YES
79# USERNAME = 77# USERNAME =
80# MAXBUF = 78# MAXBUF =
81# TIMEOUT = 79# TIMEOUT =
@@ -86,6 +84,7 @@ ALLOW_SHUTDOWN = YES
86# PREFIX = 84# PREFIX =
87 85
88[peerinfo] 86[peerinfo]
87AUTOSTART = YES
89PORT = 2090 88PORT = 2090
90HOSTNAME = localhost 89HOSTNAME = localhost
91HOME = $SERVICEHOME 90HOME = $SERVICEHOME
@@ -93,7 +92,6 @@ CONFIG = $DEFAULTCONFIG
93BINARY = gnunet-service-peerinfo 92BINARY = gnunet-service-peerinfo
94ACCEPT_FROM = 127.0.0.1; 93ACCEPT_FROM = 127.0.0.1;
95ACCEPT_FROM6 = ::1; 94ACCEPT_FROM6 = ::1;
96ALLOW_SHUTDOWN = YES
97# USERNAME = 95# USERNAME =
98# MAXBUF = 96# MAXBUF =
99# TIMEOUT = 97# TIMEOUT =
@@ -107,6 +105,7 @@ TRUST = $SERVICEHOME/data/credit/
107 105
108 106
109[transport] 107[transport]
108AUTOSTART = YES
110PORT = 2091 109PORT = 2091
111HOSTNAME = localhost 110HOSTNAME = localhost
112HOME = $SERVICEHOME 111HOME = $SERVICEHOME
@@ -115,7 +114,6 @@ BINARY = gnunet-service-transport
115NEIGHBOUR_LIMIT = 50 114NEIGHBOUR_LIMIT = 50
116ACCEPT_FROM = 127.0.0.1; 115ACCEPT_FROM = 127.0.0.1;
117ACCEPT_FROM6 = ::1; 116ACCEPT_FROM6 = ::1;
118ALLOW_SHUTDOWN = YES
119PLUGINS = tcp 117PLUGINS = tcp
120# USERNAME = 118# USERNAME =
121# MAXBUF = 119# MAXBUF =
@@ -127,6 +125,7 @@ PLUGINS = tcp
127# PREFIX = 125# PREFIX =
128 126
129[core] 127[core]
128AUTOSTART = YES
130PORT = 2092 129PORT = 2092
131HOSTNAME = localhost 130HOSTNAME = localhost
132HOME = $SERVICEHOME 131HOME = $SERVICEHOME
@@ -134,7 +133,6 @@ CONFIG = $DEFAULTCONFIG
134BINARY = gnunet-service-core 133BINARY = gnunet-service-core
135ACCEPT_FROM = 127.0.0.1; 134ACCEPT_FROM = 127.0.0.1;
136ACCEPT_FROM6 = ::1; 135ACCEPT_FROM6 = ::1;
137ALLOW_SHUTDOWN = YES
138# quotas are in bytes per second now! 136# quotas are in bytes per second now!
139TOTAL_QUOTA_IN = 65536 137TOTAL_QUOTA_IN = 65536
140TOTAL_QUOTA_OUT = 65536 138TOTAL_QUOTA_OUT = 65536
@@ -173,6 +171,7 @@ HTTP-PROXY =
173 171
174 172
175[datastore] 173[datastore]
174AUTOSTART = YES
176PORT = 2093 175PORT = 2093
177HOSTNAME = localhost 176HOSTNAME = localhost
178HOME = $SERVICEHOME 177HOME = $SERVICEHOME
@@ -180,7 +179,6 @@ CONFIG = $DEFAULTCONFIG
180BINARY = gnunet-service-datastore 179BINARY = gnunet-service-datastore
181ACCEPT_FROM = 127.0.0.1; 180ACCEPT_FROM = 127.0.0.1;
182ACCEPT_FROM6 = ::1; 181ACCEPT_FROM6 = ::1;
183ALLOW_SHUTDOWN = YES
184QUOTA = 100000000 182QUOTA = 100000000
185BLOOMFILTER = $SERVICEHOME/fs/bloomfilter 183BLOOMFILTER = $SERVICEHOME/fs/bloomfilter
186DATABASE = sqlite 184DATABASE = sqlite
@@ -189,6 +187,7 @@ DATABASE = sqlite
189FILENAME = $SERVICEHOME/datastore/sqlite.db 187FILENAME = $SERVICEHOME/datastore/sqlite.db
190 188
191[fs] 189[fs]
190AUTOSTART = YES
192INDEXDB = $SERVICEHOME/idxinfo.lst 191INDEXDB = $SERVICEHOME/idxinfo.lst
193IDENTITY_DIR = $SERVICEHOME/identities/ 192IDENTITY_DIR = $SERVICEHOME/identities/
194STATE_DIR = $SERVICEHOME/persistence/ 193STATE_DIR = $SERVICEHOME/persistence/
@@ -199,6 +198,5 @@ CONFIG = $DEFAULTCONFIG
199BINARY = gnunet-service-fs 198BINARY = gnunet-service-fs
200ACCEPT_FROM = 127.0.0.1; 199ACCEPT_FROM = 127.0.0.1;
201ACCEPT_FROM6 = ::1; 200ACCEPT_FROM6 = ::1;
202ALLOW_SHUTDOWN = YES
203# DEBUG = YES 201# DEBUG = YES
204 202
diff --git a/src/arm/gnunet-service-manager.c b/src/arm/gnunet-service-manager.c
index a55991050..79a5e5043 100644
--- a/src/arm/gnunet-service-manager.c
+++ b/src/arm/gnunet-service-manager.c
@@ -730,7 +730,8 @@ checkPortNumberCB (void *cls,
730 unsigned int i; 730 unsigned int i;
731 731
732 if ( (strcasecmp (section, "arm") == 0) || 732 if ( (strcasecmp (section, "arm") == 0) ||
733 (strcasecmp (option, "PORT") != 0) || 733 (strcasecmp (option, "AUTOSTART") != 0) ||
734 (strcasecmp (value, "YES") != 0) ||
734 (isInDefaultList (section) == GNUNET_YES) ) 735 (isInDefaultList (section) == GNUNET_YES) )
735 return; 736 return;
736 if (0 >= (ret = GNUNET_SERVICE_get_server_addresses (section, cfg, &addrs, 737 if (0 >= (ret = GNUNET_SERVICE_get_server_addresses (section, cfg, &addrs,
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c
index a8f092121..3e179e5d9 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist.c
@@ -48,7 +48,6 @@ struct PeerContext
48 struct GNUNET_CONFIGURATION_Handle *cfg; 48 struct GNUNET_CONFIGURATION_Handle *cfg;
49 struct GNUNET_TRANSPORT_Handle *th; 49 struct GNUNET_TRANSPORT_Handle *th;
50 struct GNUNET_MessageHeader *hello; 50 struct GNUNET_MessageHeader *hello;
51 struct GNUNET_ARM_Handle *arm;
52#if START_ARM 51#if START_ARM
53 pid_t arm_pid; 52 pid_t arm_pid;
54#endif 53#endif
@@ -145,7 +144,6 @@ setup_peer (struct PeerContext *p, const char *cfgname)
145 "-c", cfgname, NULL); 144 "-c", cfgname, NULL);
146#endif 145#endif
147 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 146 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
148 GNUNET_ARM_start_services (p->cfg, sched, "core", NULL);
149 p->th = GNUNET_TRANSPORT_connect (sched, p->cfg, p, NULL, 147 p->th = GNUNET_TRANSPORT_connect (sched, p->cfg, p, NULL,
150 &notify_connect, NULL); 148 &notify_connect, NULL);
151 GNUNET_assert (p->th != NULL); 149 GNUNET_assert (p->th != NULL);
@@ -174,35 +172,16 @@ waitpid_task (void *cls,
174 172
175 173
176static void 174static void
177stop_cb (void *cls, 175stop_arm (struct PeerContext *p)
178 int success)
179{ 176{
180 struct PeerContext *p = cls;
181
182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 177 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
183 success 178 "Asking ARM to stop core service\n");
184 ? "ARM stopped core service\n"
185 : "ARM failed to stop core service\n");
186 GNUNET_ARM_disconnect (p->arm);
187 p->arm = NULL;
188 /* make sure this runs after all other tasks are done */
189 GNUNET_SCHEDULER_add_delayed (sched, 179 GNUNET_SCHEDULER_add_delayed (sched,
190 GNUNET_TIME_UNIT_SECONDS, 180 GNUNET_TIME_UNIT_SECONDS,
191 &waitpid_task, p); 181 &waitpid_task, p);
192} 182}
193 183
194 184
195static void
196stop_arm (struct PeerContext *p)
197{
198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
199 "Asking ARM to stop core service\n");
200 p->arm = GNUNET_ARM_connect (p->cfg, sched, NULL);
201 GNUNET_ARM_stop_service (p->arm, "core", GNUNET_TIME_UNIT_SECONDS,
202 &stop_cb, p);
203}
204
205
206/** 185/**
207 * Try again to connect to transport service. 186 * Try again to connect to transport service.
208 */ 187 */
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
index 31aac4bdf..2a46763bf 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
+++ b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
@@ -13,7 +13,7 @@ DEBUG = NO
13 13
14[arm] 14[arm]
15PORT = 12966 15PORT = 12966
16DEFAULTSERVICES = resolver transport core statistics topology 16DEFAULTSERVICES = hostlist topology
17#GLOBAL_PREFIX = xterm -e gdb -x cmd --args 17#GLOBAL_PREFIX = xterm -e gdb -x cmd --args
18 18
19[statistics] 19[statistics]
@@ -47,4 +47,10 @@ DEBUG = NO
47[topology] 47[topology]
48#DEBUG = YES 48#DEBUG = YES
49#PREFIX = valgrind --tool=memcheck 49#PREFIX = valgrind --tool=memcheck
50DEBUG = NO \ No newline at end of file 50DEBUG = NO
51
52[fs]
53AUTOSTART = NO
54
55[datastore]
56AUTOSTART = NO[fs]
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
index f23488dfd..c256c2829 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
+++ b/src/hostlist/test_gnunet_daemon_hostlist_peer2.conf
@@ -13,7 +13,7 @@ DEBUG = NO
13 13
14[arm] 14[arm]
15PORT = 22966 15PORT = 22966
16DEFAULTSERVICES = resolver transport core statistics topology 16DEFAULTSERVICES = hostlist topology
17#GLOBAL_PREFIX = xterm -e gdb -x cmd --args 17#GLOBAL_PREFIX = xterm -e gdb -x cmd --args
18DEBUG = NO 18DEBUG = NO
19 19
@@ -47,3 +47,9 @@ HOSTLISTFILE = hostlists_peer2.file
47#DEBUG = YES 47#DEBUG = YES
48#PREFIX = valgrind --tool=memcheck 48#PREFIX = valgrind --tool=memcheck
49DEBUG = NO 49DEBUG = NO
50
51[fs]
52AUTOSTART = NO
53
54[datastore]
55AUTOSTART = NO \ No newline at end of file
diff --git a/src/util/service.c b/src/util/service.c
index 2022395f7..82e7070a1 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -511,11 +511,6 @@ struct GNUNET_SERVICE_Context
511 int require_found; 511 int require_found;
512 512
513 /** 513 /**
514 * Can clients ask us to initiate a shutdown?
515 */
516 int allow_shutdown;
517
518 /**
519 * Our options. 514 * Our options.
520 */ 515 */
521 enum GNUNET_SERVICE_Options options; 516 enum GNUNET_SERVICE_Options options;
@@ -944,7 +939,6 @@ GNUNET_SERVICE_get_server_addresses (const char *serviceName,
944 * - TIMEOUT (after how many ms does an inactive service timeout); 939 * - TIMEOUT (after how many ms does an inactive service timeout);
945 * - MAXBUF (maximum incoming message size supported) 940 * - MAXBUF (maximum incoming message size supported)
946 * - DISABLEV6 (disable support for IPv6, otherwise we use dual-stack) 941 * - DISABLEV6 (disable support for IPv6, otherwise we use dual-stack)
947 * - ALLOW_SHUTDOWN (allow clients to shutdown this service)
948 * - BINDTO (hostname or IP address to bind to, otherwise we take everything) 942 * - BINDTO (hostname or IP address to bind to, otherwise we take everything)
949 * - ACCEPT_FROM (only allow connections from specified IPv4 subnets) 943 * - ACCEPT_FROM (only allow connections from specified IPv4 subnets)
950 * - ACCEPT_FROM6 (only allow connections from specified IPv6 subnets) 944 * - ACCEPT_FROM6 (only allow connections from specified IPv6 subnets)
@@ -995,24 +989,6 @@ setup_service (struct GNUNET_SERVICE_Context *sctx)
995 } 989 }
996 else 990 else
997 maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE; 991 maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE;
998 if (GNUNET_CONFIGURATION_have_value (sctx->cfg,
999 sctx->serviceName, "ALLOW_SHUTDOWN"))
1000 {
1001 if (GNUNET_SYSERR ==
1002 (sctx->allow_shutdown =
1003 GNUNET_CONFIGURATION_get_value_yesno (sctx->cfg, sctx->serviceName,
1004 "ALLOW_SHUTDOWN")))
1005 {
1006 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1007 _("Specified value for `%s' of service `%s' is invalid\n"),
1008 "ALLOW_SHUTDOWN",
1009 sctx->serviceName);
1010 return GNUNET_SYSERR;
1011 }
1012 }
1013 else
1014 sctx->allow_shutdown = GNUNET_NO;
1015
1016 992
1017 if (GNUNET_CONFIGURATION_have_value (sctx->cfg, 993 if (GNUNET_CONFIGURATION_have_value (sctx->cfg,
1018 sctx->serviceName, "TOLERANT")) 994 sctx->serviceName, "TOLERANT"))
diff --git a/src/util/test_service.c b/src/util/test_service.c
index c406a0f24..6148fa2cc 100644
--- a/src/util/test_service.c
+++ b/src/util/test_service.c
@@ -206,38 +206,6 @@ check6 ()
206} 206}
207 207
208 208
209/**
210 * Main method, starts scheduler with task1,
211 * checks that "ok" is correct at the end.
212 */
213static int
214check6d ()
215{
216 ok = 1;
217 char *const argv[] = {
218 "test_service6",
219 "-c",
220 "test_service_data.conf",
221 "-L",
222#if VERBOSE
223 "DEBUG",
224#else
225 "WARNING",
226#endif
227 "-d",
228 NULL
229 };
230 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting V6 as daemon\n");
231 GNUNET_assert (GNUNET_OK ==
232 GNUNET_SERVICE_run (6,
233 argv,
234 "test_service6",
235 GNUNET_SERVICE_OPTION_NONE,
236 &runner6, &ok));
237 GNUNET_break (0 == ok);
238 return ok;
239}
240
241 209
242static void 210static void
243start_stop_main (void *cls, 211start_stop_main (void *cls,
@@ -322,7 +290,6 @@ main (int argc, char *argv[])
322 { 290 {
323 GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (s)); 291 GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (s));
324 ret += check6 (); 292 ret += check6 ();
325 ret += check6d (); /* with daemonization */
326 } 293 }
327 ret += check_start_stop (); 294 ret += check_start_stop ();
328 295
diff --git a/src/util/test_service_data.conf b/src/util/test_service_data.conf
index d3a3e8278..cff43ccb0 100644
--- a/src/util/test_service_data.conf
+++ b/src/util/test_service_data.conf
@@ -10,7 +10,6 @@ REJECT_FROM=1.2.3.0/15;4.5.0.0/8;6.7.8.9/255.255.255.0;
10ACCEPT_FROM6=::1; 10ACCEPT_FROM6=::1;
11REJECT_FROM6=AB:CD:EF::00;AB:CD::00/40; 11REJECT_FROM6=AB:CD:EF::00;AB:CD::00/40;
12HOSTNAME=localhost 12HOSTNAME=localhost
13ALLOW_SHUTDOWN=YES
14 13
15[test_service6] 14[test_service6]
16PORT=12435 15PORT=12435
@@ -23,7 +22,6 @@ REJECT_FROM=1.2.3.0/15;4.5.0.0/8;6.7.8.9/255.255.255.0;
23ACCEPT_FROM6=::1; 22ACCEPT_FROM6=::1;
24REJECT_FROM6=AB:CD:EF::00;AB:CD::00/40; 23REJECT_FROM6=AB:CD:EF::00;AB:CD::00/40;
25HOSTNAME=::1 24HOSTNAME=::1
26ALLOW_SHUTDOWN=YES
27 25
28[resolver] 26[resolver]
29HOSTNAME=localhost 27HOSTNAME=localhost