aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-02-03 12:54:06 -0500
committerNick Mathewson <nickm@torproject.org>2014-02-03 12:54:06 -0500
commitf96400d9df4cdf22db0c473be21024b60673b786 (patch)
tree15af08b651eac6dc0b0f753fdf7b242ee620f752 /src
parent696b484d4dc2e78ff8cf0f7c512d0dc3297197d9 (diff)
downloadtor-f96400d9df4cdf22db0c473be21024b60673b786.tar
tor-f96400d9df4cdf22db0c473be21024b60673b786.tar.gz
bug10449: a dying owning controller makes Tor exit immediately
If you want a slow shutdown, send SIGNAL SHUTDOWN. (Why not just have the default be SIGNAL QUIT? Because this case should only happen when an owning controller has crashed, and a crashed controller won't be able to give the user any "tor is shutting down" feedback, and so the user gets confused for a while. See bug 10449 for more info)
Diffstat (limited to 'src')
-rw-r--r--src/or/control.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/or/control.c b/src/or/control.c
index d24b9e4ba..c65f7bd12 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -3181,22 +3181,13 @@ connection_control_reached_eof(control_connection_t *conn)
static void
lost_owning_controller(const char *owner_type, const char *loss_manner)
{
- int shutdown_slowly = server_mode(get_options());
-
- log_notice(LD_CONTROL, "Owning controller %s has %s -- %s.",
- owner_type, loss_manner,
- shutdown_slowly ? "shutting down" : "exiting now");
+ log_notice(LD_CONTROL, "Owning controller %s has %s -- exiting now.",
+ owner_type, loss_manner);
/* XXXX Perhaps this chunk of code should be a separate function,
* called here and by process_signal(SIGINT). */
-
- if (!shutdown_slowly) {
- tor_cleanup();
- exit(0);
- }
- /* XXXX This will close all listening sockets except control-port
- * listeners. Perhaps we should close those too. */
- hibernate_begin_shutdown();
+ tor_cleanup();
+ exit(0);
}
/** Called when <b>conn</b> is being freed. */