diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-11-08 14:00:03 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-11-08 14:00:03 +0100 |
commit | 94b81ac1842414650ce542c8f336c250224c34c2 (patch) | |
tree | a16e03bb7bde639e9a229e258270c0fce4eab064 | |
parent | 03601cb008dae2d1ac3bf49205259e42e9776065 (diff) | |
download | gnunet-gtk-94b81ac1842414650ce542c8f336c250224c34c2.tar.gz gnunet-gtk-94b81ac1842414650ce542c8f336c250224c34c2.zip |
hotfix for #4760, full fix is more complex
-rw-r--r-- | src/setup/gnunet-setup-namestore-config.c | 4 | ||||
-rw-r--r-- | src/setup/gnunet-setup.c | 145 | ||||
-rw-r--r-- | src/setup/gnunet-setup.h | 11 |
3 files changed, 2 insertions, 158 deletions
diff --git a/src/setup/gnunet-setup-namestore-config.c b/src/setup/gnunet-setup-namestore-config.c index d03ca554..a664d39b 100644 --- a/src/setup/gnunet-setup-namestore-config.c +++ b/src/setup/gnunet-setup-namestore-config.c | |||
@@ -88,8 +88,8 @@ GNUNET_setup_namestore_postgres_tab_test_button_clicked_cb (GtkWidget * widget, | |||
88 | static void | 88 | static void |
89 | restart_namestore () | 89 | restart_namestore () |
90 | { | 90 | { |
91 | GNUNET_SCHEDULER_add_now (&GNUNET_SETUP_restart_namestore, | 91 | /* FIXME */ |
92 | NULL); | 92 | GNUNET_break (0); /* not implemented */ |
93 | } | 93 | } |
94 | 94 | ||
95 | 95 | ||
diff --git a/src/setup/gnunet-setup.c b/src/setup/gnunet-setup.c index 7ab9ca70..d4da0554 100644 --- a/src/setup/gnunet-setup.c +++ b/src/setup/gnunet-setup.c | |||
@@ -54,21 +54,6 @@ struct GNUNET_CONFIGURATION_Handle *cfg; | |||
54 | static int gret; | 54 | static int gret; |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * Resolver process handle. | ||
58 | */ | ||
59 | static struct GNUNET_OS_Process *resolver; | ||
60 | |||
61 | /** | ||
62 | * Namestore process handle. | ||
63 | */ | ||
64 | static struct GNUNET_OS_Process *namestore; | ||
65 | |||
66 | /** | ||
67 | * Identity process handle. | ||
68 | */ | ||
69 | static struct GNUNET_OS_Process *identity; | ||
70 | |||
71 | /** | ||
72 | * Run autoconfig-only and then exit immediately. | 57 | * Run autoconfig-only and then exit immediately. |
73 | */ | 58 | */ |
74 | static int do_autoconfig; | 59 | static int do_autoconfig; |
@@ -378,51 +363,6 @@ cleanup_task (void *cls) | |||
378 | if (GNUNET_OK != write_configuration ()) | 363 | if (GNUNET_OK != write_configuration ()) |
379 | gret = 1; | 364 | gret = 1; |
380 | cfg = NULL; | 365 | cfg = NULL; |
381 | if (NULL != resolver) | ||
382 | { | ||
383 | GNUNET_break (0 == GNUNET_OS_process_kill (resolver, SIGTERM)); | ||
384 | GNUNET_OS_process_destroy (resolver); | ||
385 | resolver = NULL; | ||
386 | } | ||
387 | if (NULL != namestore) | ||
388 | { | ||
389 | GNUNET_break (0 == GNUNET_OS_process_kill (namestore, SIGTERM)); | ||
390 | GNUNET_OS_process_destroy (namestore); | ||
391 | namestore = NULL; | ||
392 | } | ||
393 | if (NULL != identity) | ||
394 | { | ||
395 | GNUNET_break (0 == GNUNET_OS_process_kill (identity, SIGTERM)); | ||
396 | GNUNET_OS_process_destroy (identity); | ||
397 | identity = NULL; | ||
398 | } | ||
399 | } | ||
400 | |||
401 | |||
402 | /** | ||
403 | * Write configuration to dis, (re)start the namestore process and | ||
404 | * reload the namestore models. | ||
405 | * | ||
406 | * | ||
407 | * @param cls closure (unused) | ||
408 | */ | ||
409 | void | ||
410 | GNUNET_SETUP_restart_namestore (void *cls) | ||
411 | { | ||
412 | if (GNUNET_OK != write_configuration ()) | ||
413 | return; /* no point in re-starting namestore ... */ | ||
414 | if (NULL != namestore) | ||
415 | { | ||
416 | GNUNET_break (0 == GNUNET_OS_process_kill (namestore, SIGTERM)); | ||
417 | GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (namestore)); | ||
418 | GNUNET_OS_process_destroy (namestore); | ||
419 | namestore = NULL; | ||
420 | } | ||
421 | namestore = | ||
422 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ALL, | ||
423 | NULL, NULL, NULL, | ||
424 | "gnunet-service-namestore", | ||
425 | "gnunet-service-namestore", NULL); | ||
426 | } | 366 | } |
427 | 367 | ||
428 | 368 | ||
@@ -436,79 +376,6 @@ GNUNET_SETUP_quit_cb (GObject * object, gpointer user_data) | |||
436 | } | 376 | } |
437 | 377 | ||
438 | 378 | ||
439 | /** | ||
440 | * If the test failed, start the resolver process. | ||
441 | * | ||
442 | * @param cls closure, NULL | ||
443 | * @param result #GNUNET_YES if the service is running | ||
444 | */ | ||
445 | static void | ||
446 | start_resolver (void *cls, | ||
447 | int result) | ||
448 | { | ||
449 | char *binary; | ||
450 | |||
451 | if (GNUNET_YES == result) | ||
452 | return; | ||
453 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); | ||
454 | resolver = | ||
455 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ALL, | ||
456 | NULL,NULL, NULL, | ||
457 | binary, | ||
458 | "gnunet-service-resolver", NULL); | ||
459 | GNUNET_free (binary); | ||
460 | } | ||
461 | |||
462 | |||
463 | /** | ||
464 | * If the test failed, start the identity process. | ||
465 | * | ||
466 | * @param cls closure, NULL | ||
467 | * @param result #GNUNET_YES if the service is running | ||
468 | */ | ||
469 | static void | ||
470 | start_identity (void *cls, | ||
471 | int result) | ||
472 | { | ||
473 | char *binary; | ||
474 | |||
475 | if (GNUNET_YES == result) | ||
476 | return; | ||
477 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-identity"); | ||
478 | identity = | ||
479 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ALL, | ||
480 | NULL, NULL, NULL, | ||
481 | binary, | ||
482 | "gnunet-service-identity", NULL); | ||
483 | GNUNET_free (binary); | ||
484 | } | ||
485 | |||
486 | |||
487 | /** | ||
488 | * If the test failed, start the namestore process. | ||
489 | * | ||
490 | * @param cls closure, NULL | ||
491 | * @param result #GNUNET_YES if the service is running | ||
492 | */ | ||
493 | static void | ||
494 | start_namestore (void *cls, | ||
495 | int result) | ||
496 | { | ||
497 | char *binary; | ||
498 | |||
499 | if (GNUNET_YES == result) | ||
500 | return; | ||
501 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-namestore"); | ||
502 | namestore = | ||
503 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ALL, | ||
504 | NULL, NULL, NULL, | ||
505 | binary, | ||
506 | "gnunet-service-namestore", NULL); | ||
507 | GNUNET_free (binary); | ||
508 | } | ||
509 | |||
510 | |||
511 | |||
512 | #ifndef MINGW | 379 | #ifndef MINGW |
513 | /** | 380 | /** |
514 | * Try elevating user priviledges to run as user 'gnunet' or 'root'. | 381 | * Try elevating user priviledges to run as user 'gnunet' or 'root'. |
@@ -650,18 +517,6 @@ run (void *cls) | |||
650 | main_window = GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_dialog")); | 517 | main_window = GTK_WIDGET (GNUNET_SETUP_get_object ("GNUNET_setup_dialog")); |
651 | main_window = GNUNET_GTK_plug_me ("GNUNET_FS_GTK_PLUG", | 518 | main_window = GNUNET_GTK_plug_me ("GNUNET_FS_GTK_PLUG", |
652 | main_window); | 519 | main_window); |
653 | GNUNET_CLIENT_service_test ("resolver", | ||
654 | cfg, | ||
655 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, | ||
656 | &start_resolver, NULL); | ||
657 | GNUNET_CLIENT_service_test ("namestore", | ||
658 | cfg, | ||
659 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, | ||
660 | &start_namestore, NULL); | ||
661 | GNUNET_CLIENT_service_test ("identity", | ||
662 | cfg, | ||
663 | GNUNET_CONSTANTS_SERVICE_TIMEOUT, | ||
664 | &start_identity, NULL); | ||
665 | load_options (); | 520 | load_options (); |
666 | GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); | 521 | GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); |
667 | if (do_autoconfig) | 522 | if (do_autoconfig) |
diff --git a/src/setup/gnunet-setup.h b/src/setup/gnunet-setup.h index 40fd6e2e..fde0b27a 100644 --- a/src/setup/gnunet-setup.h +++ b/src/setup/gnunet-setup.h | |||
@@ -58,17 +58,6 @@ enum GNUNET_GTK_SETUP_HostlistUrlModelColumns | |||
58 | GObject * | 58 | GObject * |
59 | GNUNET_SETUP_get_object (const char *name); | 59 | GNUNET_SETUP_get_object (const char *name); |
60 | 60 | ||
61 | |||
62 | /** | ||
63 | * Write configuration to dis, (re)start the namestore process and | ||
64 | * reload the namestore models. | ||
65 | * | ||
66 | * | ||
67 | * @param cls closure (unused) | ||
68 | */ | ||
69 | void | ||
70 | GNUNET_SETUP_restart_namestore (void *cls); | ||
71 | |||
72 | /** | 61 | /** |
73 | * Our configuration. | 62 | * Our configuration. |
74 | */ | 63 | */ |