]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
bugfix: we were starting to daemonize before we opened our logs,
authorRoger Dingledine <arma@torproject.org>
Thu, 23 Sep 2004 04:32:43 +0000 (04:32 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 23 Sep 2004 04:32:43 +0000 (04:32 +0000)
so if there were any problems opening logs, we would complain to
stderr (which wouldn't work) and then mysteriously exit.

svn:r2366

src/or/main.c

index 4a0ae66427436c6d039bf573598f40ff6e8fb969..8076403940e1523bfdba821aefe555e3332a781f 100644 (file)
@@ -690,11 +690,6 @@ static int init_from_config(int argc, char **argv) {
     return -1;
   }
 
-  /* Start backgrounding the process, if requested. */
-  if (options.RunAsDaemon) {
-    start_daemon(get_data_directory(&options));
-  }
-
   /* Configure the log(s) */
   if (config_init_logs(&options)<0)
     return -1;
@@ -702,6 +697,11 @@ static int init_from_config(int argc, char **argv) {
    * gone. */
   close_temp_logs();
 
+  /* Start backgrounding the process, if requested. */
+  if (options.RunAsDaemon) {
+    start_daemon(get_data_directory(&options));
+  }
+
   /* Set up our buckets */
   connection_bucket_init();
   stats_prev_global_read_bucket = global_read_bucket;