Commit 8727a281 authored by Roger Dingledine's avatar Roger Dingledine
Browse files

bugfix: we were starting to daemonize before we opened our logs,

so if there were any problems opening logs, we would complain to
stderr (which wouldn't work) and then mysteriously exit.


svn:r2366
parent f753f6f0
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -690,11 +690,6 @@ static int init_from_config(int argc, char **argv) {
    return -1;
    return -1;
  }
  }


  /* Start backgrounding the process, if requested. */
  if (options.RunAsDaemon) {
    start_daemon(get_data_directory(&options));
  }

  /* Configure the log(s) */
  /* Configure the log(s) */
  if (config_init_logs(&options)<0)
  if (config_init_logs(&options)<0)
    return -1;
    return -1;
@@ -702,6 +697,11 @@ static int init_from_config(int argc, char **argv) {
   * gone. */
   * gone. */
  close_temp_logs();
  close_temp_logs();


  /* Start backgrounding the process, if requested. */
  if (options.RunAsDaemon) {
    start_daemon(get_data_directory(&options));
  }

  /* Set up our buckets */
  /* Set up our buckets */
  connection_bucket_init();
  connection_bucket_init();
  stats_prev_global_read_bucket = global_read_bucket;
  stats_prev_global_read_bucket = global_read_bucket;