]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
bug10449: a dying owning controller makes Tor exit immediately
authorNick Mathewson <nickm@torproject.org>
Mon, 3 Feb 2014 17:54:06 +0000 (12:54 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 3 Feb 2014 17:54:06 +0000 (12:54 -0500)
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)

changes/bug10449 [new file with mode: 0644]
src/or/control.c

diff --git a/changes/bug10449 b/changes/bug10449
new file mode 100644 (file)
index 0000000..93811f0
--- /dev/null
@@ -0,0 +1,8 @@
+  o Minor bugfixes:
+    - Exit immediately when exiting because of dropped connection from
+      a process-owning controller. Previously, if we were running in
+      server mode, we would wait for a little while as in the when we
+      got an INT signal--but this was problematic, since there was no
+      feedback for the user. Controllers that want to do a clean
+      shutdown should send an INT signal, and let the user know what's
+      going on. Fix for bug 10449; bugfix on 0.2.2.28-beta.
\ No newline at end of file
index d24b9e4bab0913cb6831499a2fba11ee2053667c..c65f7bd123d39850908c1d2c20a16226c76d02bc 100644 (file)
@@ -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. */