From 27728a48d661e9ee546cc95aae8fa52050eefb29 Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Sat, 12 Oct 2013 00:07:33 +0000 Subject: - change --enable-ll to --enable-supermuc - define a system wide termination signal GNUNET_TERM_SIG. Set this to SIGUSR1 only when building for SuperMUC --- configure.ac | 25 +++++++++++----------- src/arm/gnunet-service-arm.c | 4 ++-- src/core/test_core_api.c | 2 +- src/core/test_core_api_reliability.c | 2 +- src/core/test_core_api_start_only.c | 2 +- src/core/test_core_quota_compliance.c | 2 +- src/dns/gnunet-helper-dns.c | 12 +++++++++++ src/hostlist/test_gnunet_daemon_hostlist.c | 2 +- .../test_gnunet_daemon_hostlist_learning.c | 4 ++-- .../test_gnunet_daemon_hostlist_reconnect.c | 2 +- src/include/platform.h | 6 ++++++ src/nat/nat.c | 4 ++-- src/nat/test_nat_test.c | 2 +- src/statistics/test_statistics_api.c | 4 ++-- src/statistics/test_statistics_api_loop.c | 2 +- src/statistics/test_statistics_api_watch.c | 2 +- .../test_statistics_api_watch_zero_value.c | 2 +- src/testbed/Makefile.am | 14 ------------ src/testbed/gnunet-helper-testbed.c | 4 ++-- src/testbed/gnunet-testbed-profiler.c | 4 ++-- src/testbed/gnunet_testbed_mpi_spawn.c | 2 +- src/testbed/testbed_api_hosts.c | 4 ++-- src/testbed/testbed_api_testbed.c | 2 +- src/testing/testing.c | 4 ++-- src/transport/gnunet-helper-transport-wlan-dummy.c | 3 ++- src/transport/gnunet-transport.c | 2 +- src/util/gnunet-uri.c | 2 +- src/util/helper.c | 2 +- src/util/os_priority.c | 3 +++ src/util/scheduler.c | 9 ++++++++ src/util/test_common_logging_runtime_loglevels.c | 2 +- src/util/test_os_start_process.c | 6 +++--- src/util/test_resolver_api.c | 2 +- src/util/test_scheduler.c | 2 +- 34 files changed, 81 insertions(+), 65 deletions(-) diff --git a/configure.ac b/configure.ac index 2e191abf3..2e0bda700 100644 --- a/configure.ac +++ b/configure.ac @@ -1036,22 +1036,21 @@ AC_DEFINE_UNQUOTED([HAVE_GNUTLS], $gnutls, [We have gnutls]) # Test if we are building for superMUC -AC_MSG_CHECKING(if testbed should use IBM LoadLeveler to run on SuperMUC) -AC_ARG_ENABLE([ll], - [AS_HELP_STRING([--enable-ll], - [build GNUnet testbed for use with IBM LoadLeveler for running testbed on - SuperMUC (default is NO)])], - [if test "x$enable_ll" = "xno" +AC_MSG_CHECKING(if GNUnet is being configured to run on the SuperMUC) +AC_ARG_ENABLE([supermuc], + [AS_HELP_STRING([--enable-supermuc], + [build GNUnet with support to run on the SuperMUC (default is NO)])], + [if test "x$enable_supermuc" = "xno" then - ll=0 + supermuc=0 else - ll=1 + supermuc=1 fi], - [ll=0 - enable_ll=no]) -AC_MSG_RESULT($enable_ll) -AM_CONDITIONAL([ENABLE_LL], [test "x$ll" = "x1"]) -AC_DEFINE_UNQUOTED([ENABLE_LL], [$ll], [Build with LL support]) + [supermuc=0 + enable_supermuc=no]) +AC_MSG_RESULT($enable_SUPERMUC) +AM_CONDITIONAL([ENABLE_SUPERMUC], [test "x$supermuc" = "x1"]) +AC_DEFINE_UNQUOTED([ENABLE_SUPERMUC], [$supermuc], [Build with support for SuperMUC]) # Check if NSE has to send timestamp information to testbed logger for # generating histogram of messages received diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 1eaaa26c5..f5323c042 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c @@ -851,7 +851,7 @@ handle_stop (void *cls, struct GNUNET_SERVER_Client *client, broadcast_status (servicename, GNUNET_ARM_SERVICE_STOPPING, NULL); /* no signal_start - only when it's STOPPED */ sl->killed_at = GNUNET_TIME_absolute_get (); - if (0 != GNUNET_OS_process_kill (sl->proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (sl->proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); sl->killing_client = client; sl->killing_client_request_id = request_id; @@ -1013,7 +1013,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) "Stopping service `%s'\n", pos->name); pos->killed_at = GNUNET_TIME_absolute_get (); - if (0 != GNUNET_OS_process_kill (pos->proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (pos->proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); } else diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index 12745c984..af2b98e41 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c @@ -334,7 +334,7 @@ run (void *cls, char *const *args, const char *cfgfile, static void stop_arm (struct PeerContext *p) { - if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (p->arm_proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index ddc3c585e..97006fe95 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -447,7 +447,7 @@ run (void *cls, char *const *args, const char *cfgfile, static void stop_arm (struct PeerContext *p) { - if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (p->arm_proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c index 0389a908e..255de0319 100644 --- a/src/core/test_core_api_start_only.c +++ b/src/core/test_core_api_start_only.c @@ -184,7 +184,7 @@ static void stop_arm (struct PeerContext *p) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peer\n"); - if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (p->arm_proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 7c1b198c9..71b842522 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -627,7 +627,7 @@ run (void *cls, char *const *args, const char *cfgfile, static void stop_arm (struct PeerContext *p) { - if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (p->arm_proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); diff --git a/src/dns/gnunet-helper-dns.c b/src/dns/gnunet-helper-dns.c index 8ff6413f8..7764e7b4a 100644 --- a/src/dns/gnunet-helper-dns.c +++ b/src/dns/gnunet-helper-dns.c @@ -838,6 +838,9 @@ main (int argc, char *const*argv) } } if ( (SIG_ERR == signal (SIGTERM, &signal_handler)) || +#if (SIGTERM != GNUNET_TERM_SIG) + (SIG_ERR == signal (GNUNET_TERM_SIG, &signal_handler)) || +#endif (SIG_ERR == signal (SIGINT, &signal_handler)) || (SIG_ERR == signal (SIGHUP, &signal_handler)) ) { @@ -875,6 +878,9 @@ main (int argc, char *const*argv) { fprintf (stderr, "Fatal: could not initialize tun-interface\n"); (void) signal (SIGTERM, SIG_IGN); +#if (SIGTERM != GNUNET_TERM_SIG) + (void) signal (GNUNET_TERM_SIG, SIG_IGN); +#endif (void) signal (SIGINT, SIG_IGN); (void) signal (SIGHUP, SIG_IGN); (void) close (cpipe[0]); @@ -891,6 +897,9 @@ main (int argc, char *const*argv) { fprintf (stderr, "Fatal: prefix_len out of range\n"); (void) signal (SIGTERM, SIG_IGN); +#if (SIGTERM != GNUNET_TERM_SIG) + (void) signal (GNUNET_TERM_SIG, SIG_IGN); +#endif (void) signal (SIGINT, SIG_IGN); (void) signal (SIGHUP, SIG_IGN); (void) close (cpipe[0]); @@ -1043,6 +1052,9 @@ main (int argc, char *const*argv) (void) close (fd_tun); /* remove signal handler so we can close the pipes */ (void) signal (SIGTERM, SIG_IGN); +#if (SIGTERM != GNUNET_TERM_SIG) + (void) signal (GNUNET_TERM_SIG, SIG_IGN); +#endif (void) signal (SIGINT, SIG_IGN); (void) signal (SIGHUP, SIG_IGN); (void) close (cpipe[0]); diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c index 670c2ec28..2e1e5acb5 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist.c +++ b/src/hostlist/test_gnunet_daemon_hostlist.c @@ -153,7 +153,7 @@ waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct PeerContext *p = cls; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing ARM process.\n"); - if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (p->arm_proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index 647b5983e..f581b532a 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c @@ -145,7 +145,7 @@ shutdown_testcase () } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing hostlist server ARM process.\n"); - if (0 != GNUNET_OS_process_kill (adv_peer.arm_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (adv_peer.arm_proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (adv_peer.arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); @@ -153,7 +153,7 @@ shutdown_testcase () adv_peer.arm_proc = NULL; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing hostlist client ARM process.\n"); - if (0 != GNUNET_OS_process_kill (learn_peer.arm_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (learn_peer.arm_proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (learn_peer.arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c index 21b2973de..6b38ffe19 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c @@ -153,7 +153,7 @@ waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct PeerContext *p = cls; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing ARM process.\n"); - if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (p->arm_proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); diff --git a/src/include/platform.h b/src/include/platform.h index e74427391..9d58427b9 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -266,4 +266,10 @@ atoll (const char *nptr); #define SOCKTYPE int #endif +#if ENABLE_SUPERMUC +#define GNUNET_TERM_SIG SIGUSR1 +#else +#define GNUNET_TERM_SIG SIGTERM +#endif + #endif diff --git a/src/nat/nat.c b/src/nat/nat.c index 03a77ddc3..6e55e3bc7 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c @@ -789,7 +789,7 @@ nat_server_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { LOG (GNUNET_ERROR_TYPE_DEBUG, "Finished reading from server stdout with code: %d\n", bytes); - if (0 != GNUNET_OS_process_kill (h->server_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (h->server_proc, GNUNET_TERM_SIG)) GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_WARNING, "nat", "kill"); GNUNET_OS_process_wait (h->server_proc); GNUNET_OS_process_destroy (h->server_proc); @@ -1303,7 +1303,7 @@ GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h) } if (NULL != h->server_proc) { - if (0 != GNUNET_OS_process_kill (h->server_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (h->server_proc, GNUNET_TERM_SIG)) GNUNET_log_from_strerror (GNUNET_ERROR_TYPE_WARNING, "nat", "kill"); GNUNET_OS_process_wait (h->server_proc); GNUNET_OS_process_destroy (h->server_proc); diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c index d017dffbd..752c8f145 100644 --- a/src/nat/test_nat_test.c +++ b/src/nat/test_nat_test.c @@ -107,7 +107,7 @@ main (int argc, char *const argv[]) GNUNET_assert (NULL != gns); GNUNET_PROGRAM_run (3, argv_prog, "test-nat-test", "nohelp", options, &run, NULL); - GNUNET_break (0 == GNUNET_OS_process_kill (gns, SIGTERM)); + GNUNET_break (0 == GNUNET_OS_process_kill (gns, GNUNET_TERM_SIG)); GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (gns)); GNUNET_OS_process_destroy (gns); if (0 != ret) diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c index 47871fa7b..aa9088f35 100644 --- a/src/statistics/test_statistics_api.c +++ b/src/statistics/test_statistics_api.c @@ -153,7 +153,7 @@ main (int argc, char *argv_ign[]) GNUNET_assert (NULL != proc); GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options, &run, &ok); - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); ok = 1; @@ -175,7 +175,7 @@ main (int argc, char *argv_ign[]) "-c", "test_statistics_api_data.conf", NULL); GNUNET_PROGRAM_run (5, argv, "test-statistics-api", "nohelp", options, &run_more, &ok); - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); ok = 1; diff --git a/src/statistics/test_statistics_api_loop.c b/src/statistics/test_statistics_api_loop.c index 987b6c57b..7a7b44c1f 100644 --- a/src/statistics/test_statistics_api_loop.c +++ b/src/statistics/test_statistics_api_loop.c @@ -101,7 +101,7 @@ main (int argc, char *argv_ign[]) GNUNET_assert (NULL != proc); GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run, &ok); - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); ok = 1; diff --git a/src/statistics/test_statistics_api_watch.c b/src/statistics/test_statistics_api_watch.c index e75cab5f6..78bc425c5 100644 --- a/src/statistics/test_statistics_api_watch.c +++ b/src/statistics/test_statistics_api_watch.c @@ -130,7 +130,7 @@ main (int argc, char *argv_ign[]) ok = 3; GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run, NULL); - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); ok = 1; diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c index d78de9a9e..c42c44428 100644 --- a/src/statistics/test_statistics_api_watch_zero_value.c +++ b/src/statistics/test_statistics_api_watch_zero_value.c @@ -166,7 +166,7 @@ main (int argc, char *argv_ign[]) ok2 = 1; GNUNET_PROGRAM_run (3, argv, "test-statistics-api", "nohelp", options, &run, NULL); - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); ok = 1; diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am index f5d3647ae..57ea49a00 100644 --- a/src/testbed/Makefile.am +++ b/src/testbed/Makefile.am @@ -9,11 +9,6 @@ if USE_COVERAGE XLIB = -lgcov endif -if ENABLE_LL - ll_binaries = \ - gnunet-testbed-mpi-spawn -endif - libexecdir= $(pkglibdir)/libexec/ pkgcfgdir= $(pkgdatadir)/config.d/ @@ -28,7 +23,6 @@ libexec_PROGRAMS = \ gnunet-daemon-testbed-blacklist bin_PROGRAMS = \ - $(ll_binaries) \ gnunet-testbed-profiler gnunet_service_testbed_SOURCES = \ @@ -93,14 +87,6 @@ gnunet_daemon_testbed_blacklist_DEPENDENCIES = \ $(top_builddir)/src/transport/libgnunettransport.la \ $(top_builddir)/src/util/libgnunetutil.la -gnunet_testbed_mpi_spawn_SOURCES = gnunet_testbed_mpi_spawn.c -gnunet_testbed_mpi_spawn_LDADD = $(XLIB) \ - $(top_builddir)/src/util/libgnunetutil.la \ - $(top_builddir)/src/testbed/libgnunettestbed.la -gnunet_testbed_mpi_spawn_DEPENDENCIES = \ - $(top_builddir)/src/util/libgnunetutil.la \ - libgnunettestbed.la - lib_LTLIBRARIES = \ libgnunettestbed.la \ libgnunettestbedlogger.la diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index f89d8af8f..43040e146 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c @@ -166,7 +166,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (NULL != testbed) { LOG_DEBUG ("Killing testbed\n"); - GNUNET_break (0 == GNUNET_OS_process_kill (testbed, SIGTERM)); + GNUNET_break (0 == GNUNET_OS_process_kill (testbed, GNUNET_TERM_SIG)); } if (GNUNET_SCHEDULER_NO_TASK != read_task_id) { @@ -298,7 +298,7 @@ child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_OS_process_destroy (testbed); testbed = NULL; /* Send SIGTERM to our process group */ - if (0 != PLIBC_KILL (0, SIGTERM)) + if (0 != PLIBC_KILL (0, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "signal"); shutdown_now (); /* Couldn't send the signal, we shutdown frowning */ diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index c6c472f92..5e4678590 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c @@ -225,7 +225,7 @@ test_run (void *cls, result = GNUNET_OK; fprintf (stdout, "\n"); print_overlay_links_summary (); -#if !ENABLE_LL +#if !ENABLE_SUPERMUC fprintf (stdout, "Testbed running, waiting for keystroke to shut down\n"); fflush (stdout); (void) getc (stdin); @@ -281,7 +281,7 @@ main (int argc, char *const *argv) {'e', "num-errors", "COUNT", gettext_noop ("tolerate COUNT number of continious timeout failures"), GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_cont_fails}, -#if !ENABLE_LL +#if !ENABLE_SUPERMUC {'H', "hosts", "FILENAME", gettext_noop ("name of the file with the login information for the testbed"), GNUNET_YES, &GNUNET_GETOPT_set_string, &hosts_file}, diff --git a/src/testbed/gnunet_testbed_mpi_spawn.c b/src/testbed/gnunet_testbed_mpi_spawn.c index a7652cfd8..d3a78d3d4 100644 --- a/src/testbed/gnunet_testbed_mpi_spawn.c +++ b/src/testbed/gnunet_testbed_mpi_spawn.c @@ -121,7 +121,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } } hard_kill++; - GNUNET_break (0 == GNUNET_OS_process_kill (child, SIGTERM)); + GNUNET_break (0 == GNUNET_OS_process_kill (child, GNUNET_TERM_SIG)); LOG (GNUNET_ERROR_TYPE_INFO, _("Waiting for child to exit.\n")); } diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index 51bd632c7..2b0d20127 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c @@ -565,7 +565,7 @@ GNUNET_TESTBED_hosts_load_from_loadleveler (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTBED_Host ***hosts) { -#if !ENABLE_LL +#if !ENABLE_SUPERMUC LOG (GNUNET_ERROR_TYPE_ERROR, _("The function %s is only available when compiled with (--with-ll)\n"), __func__); @@ -1374,7 +1374,7 @@ GNUNET_TESTBED_is_host_habitable_cancel (struct *handle) { GNUNET_SCHEDULER_cancel (handle->habitability_check_task); - (void) GNUNET_OS_process_kill (handle->auxp, SIGTERM); + (void) GNUNET_OS_process_kill (handle->auxp, GNUNET_TERM_SIG); (void) GNUNET_OS_process_wait (handle->auxp); GNUNET_OS_process_destroy (handle->auxp); free_argv (handle->helper_argv); diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 2d420c3e3..17f50bad6 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c @@ -1255,7 +1255,7 @@ GNUNET_TESTBED_run (const char *host_filename, GNUNET_assert (num_peers > 0); rc = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_RunHandle)); rc->cfg = GNUNET_CONFIGURATION_dup (cfg); -#if ENABLE_LL +#if ENABLE_SUPERMUC rc->num_hosts = GNUNET_TESTBED_hosts_load_from_loadleveler (rc->cfg, &rc->hosts); if (0 == rc->num_hosts) diff --git a/src/testing/testing.c b/src/testing/testing.c index cfca8ce9b..629089f87 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -508,7 +508,7 @@ static void stop_shared_service_instance (struct SharedServiceInstance *i) { GNUNET_break (0 == i->n_refs); - if (0 != GNUNET_OS_process_kill (i->proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (i->proc, GNUNET_TERM_SIG)) LOG (GNUNET_ERROR_TYPE_WARNING, "Killing shared service instance (%s) failed\n", i->ss->sname); (void) GNUNET_OS_process_wait (i->proc); @@ -1418,7 +1418,7 @@ GNUNET_TESTING_peer_kill (struct GNUNET_TESTING_Peer *peer) GNUNET_break (0); return GNUNET_SYSERR; } - if (0 != GNUNET_OS_process_kill (peer->main_process, SIGTERM)) + if (0 != GNUNET_OS_process_kill (peer->main_process, GNUNET_TERM_SIG)) return GNUNET_SYSERR; for (cnt = 0; cnt < peer->system->n_shared_services; cnt++) { diff --git a/src/transport/gnunet-helper-transport-wlan-dummy.c b/src/transport/gnunet-helper-transport-wlan-dummy.c index d07b1f8f6..e6be00a73 100644 --- a/src/transport/gnunet-helper-transport-wlan-dummy.c +++ b/src/transport/gnunet-helper-transport-wlan-dummy.c @@ -314,7 +314,8 @@ main (int argc, char *argv[]) signal (SIGINT, &sigfunc); signal (SIGTERM, &sigfunc); - + signal (GNUNET_TERM_SIG, &sigfunc); + write_std.size = 0; write_std.pos = 0; write_pout.size = 0; diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index ed47e29e1..0393a06cc 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c @@ -358,7 +358,7 @@ display_test_result (struct TestContext *tc, int result) resolver_users--; if ((0 == resolver_users) && (NULL != resolver)) { - GNUNET_break (0 == GNUNET_OS_process_kill (resolver, SIGTERM)); + GNUNET_break (0 == GNUNET_OS_process_kill (resolver, GNUNET_TERM_SIG)); GNUNET_OS_process_destroy (resolver); resolver = NULL; } diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c index 1964aade4..3465b5906 100644 --- a/src/util/gnunet-uri.c +++ b/src/util/gnunet-uri.c @@ -62,7 +62,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) (0 == code) ) ret = 0; else - GNUNET_break (0 == GNUNET_OS_process_kill (p, SIGTERM)); + GNUNET_break (0 == GNUNET_OS_process_kill (p, GNUNET_TERM_SIG)); GNUNET_OS_process_destroy (p); } diff --git a/src/util/helper.c b/src/util/helper.c index 21f196ebc..404dad4fa 100644 --- a/src/util/helper.c +++ b/src/util/helper.c @@ -208,7 +208,7 @@ GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h, h->fh_to_helper = NULL; return ret; } - if (0 != GNUNET_OS_process_kill (h->helper_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (h->helper_proc, GNUNET_TERM_SIG)) return GNUNET_SYSERR; return GNUNET_OK; } diff --git a/src/util/os_priority.c b/src/util/os_priority.c index d499ed985..1466ce059 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -229,6 +229,9 @@ GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig) case SIGINT: case SIGKILL: case SIGTERM: +#if (SIGTERM != GNUNET_TERM_SIG) + case GNUNET_TERM_SIG: +#endif #if defined(WINDOWS) && !defined(__CYGWIN__) { DWORD exitcode; diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 8652ee297..36c3a443b 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c @@ -717,6 +717,9 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls) int ret; struct GNUNET_SIGNAL_Context *shc_int; struct GNUNET_SIGNAL_Context *shc_term; +#if (SIGTERM != GNUNET_TERM_SIG) + struct GNUNET_SIGNAL_Context *shc_gterm; +#endif #ifndef MINGW struct GNUNET_SIGNAL_Context *shc_quit; @@ -741,6 +744,9 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls) LOG (GNUNET_ERROR_TYPE_DEBUG, "Registering signal handlers\n"); shc_int = GNUNET_SIGNAL_handler_install (SIGINT, &sighandler_shutdown); shc_term = GNUNET_SIGNAL_handler_install (SIGTERM, &sighandler_shutdown); +#if (SIGTERM != GNUNET_TERM_SIG) + shc_gterm = GNUNET_SIGNAL_handler_install (GNUNET_TERM_SIG, &sighandler_shutdown); +#endif #ifndef MINGW shc_pipe = GNUNET_SIGNAL_handler_install (SIGPIPE, &sighandler_pipe); shc_quit = GNUNET_SIGNAL_handler_install (SIGQUIT, &sighandler_shutdown); @@ -820,6 +826,9 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls) } GNUNET_SIGNAL_handler_uninstall (shc_int); GNUNET_SIGNAL_handler_uninstall (shc_term); +#if (SIGTERM != GNUNET_TERM_SIG) + GNUNET_SIGNAL_handler_install (shc_gterm); +#endif #ifndef MINGW GNUNET_SIGNAL_handler_uninstall (shc_pipe); GNUNET_SIGNAL_handler_uninstall (shc_quit); diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index 7d8834082..14055e11f 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c @@ -64,7 +64,7 @@ end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) ok); if (NULL != proc) { - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); } diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index 8e701750b..90d8ae101 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c @@ -60,7 +60,7 @@ struct read_context rc; static void end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); } @@ -207,7 +207,7 @@ check_kill () "gnunet-service-resolver", "-", NULL); sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */ GNUNET_free (fn); - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (proc)); GNUNET_OS_process_destroy (proc); @@ -236,7 +236,7 @@ check_instant_kill () proc = GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, hello_pipe_stdin, hello_pipe_stdout, fn, "gnunet-service-resolver", "-", NULL); - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); } diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index bcbaf4f04..220f4bdac 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c @@ -374,7 +374,7 @@ main (int argc, char *argv[]) GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx, "test-resolver-api", "nohelp", options, &run, &ok)); - if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); ok = 1; diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c index 70ff95550..4cfd81c81 100644 --- a/src/util/test_scheduler.c +++ b/src/util/test_scheduler.c @@ -183,7 +183,7 @@ taskSig (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_assert (1 == *ok); *ok = 8; GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &taskLast, cls); - GNUNET_break (0 == PLIBC_KILL (getpid (), SIGTERM)); + GNUNET_break (0 == PLIBC_KILL (getpid (), GNUNET_TERM_SIG)); } -- cgit v1.2.3