From 97d9ba2380e0c894a1b611bdb4f35d0fe98a837a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 11 Dec 2017 10:57:00 -0500 Subject: Add a mostly disabled feature to debug restarting in-process For 23847, we want Tor to be able to shut down and then restart in the same process. Here's a patch to make the Tor binary do that. To test it, you need to build with --enable-restart-debugging, and then you need to set the environment variable TOR_DEBUG_RESTART. With this option, Tor will then run for 5 seconds, then restart itself in-process without exiting. This only happens once. You can change the 5-second interval using TOR_DEBUG_RESTART_AFTER_SECONDS. Implements ticket 24583. --- configure.ac | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index ee75d3a29e..36a27b54bd 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,8 @@ AC_ARG_ENABLE(rust, AS_HELP_STRING(--enable-rust, [enable rust integration])) AC_ARG_ENABLE(cargo-online-mode, AS_HELP_STRING(--enable-cargo-online-mode, [Allow cargo to make network requests to fetch crates. For builds with rust only.])) +AC_ARG_ENABLE(restart-debugging, + AS_HELP_STRING(--enable-restart-debugging, [Build Tor with support for debugging in-process restart. Developers only.])) if test "x$enable_coverage" != "xyes" -a "x$enable_asserts_in_tests" = "xno" ; then AC_MSG_ERROR([Can't disable assertions outside of coverage build]) @@ -107,6 +109,10 @@ AC_ARG_ENABLE(systemd, * ) AC_MSG_ERROR(bad value for --enable-systemd) ;; esac], [systemd=auto]) +if test "$enable_restart_debugging" = "yes"; then + AC_DEFINE(ENABLE_RESTART_DEBUGGING, 1, + [Defined if we're building with support for in-process restart debugging.]) +fi # systemd support -- cgit v1.2.3-54-g00ecf