[or-cvs] bugfix: chdir to your datadirectory at the *end* of the

Roger Dingledine arma at seul.org
Wed Apr 6 19:07:41 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	config.c 
Log Message:
bugfix: chdir to your datadirectory at the *end* of the
daemonize process, not the beginning. this was a problem
because the first time you run tor, if your datadir isn't
there, and you have runasdaemon set to 1, it will try to
chdir to it before it tries to create it. oops.


Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.332
retrieving revision 1.333
diff -u -d -r1.332 -r1.333
--- config.c	5 Apr 2005 22:56:16 -0000	1.332
+++ config.c	6 Apr 2005 19:07:38 -0000	1.333
@@ -266,7 +266,7 @@
    *    It let us have the parent process stick around until we were sure Tor
    *    was started.  Should we make start_daemon get called earlier? -NM */
   if (options->RunAsDaemon) {
-    start_daemon(options->DataDirectory);
+    start_daemon();
   }
   if (!libevent_initialized) {
     configure_libevent_logging();
@@ -346,7 +346,7 @@
   /* Finish backgrounding the process */
   if (options->RunAsDaemon) {
     /* We may be calling this for the n'th time (on SIGHUP), but it's safe. */
-    finish_daemon();
+    finish_daemon(options->DataDirectory);
   }
 
   /* Write our pid to the pid file. If we do not have write permissions we



More information about the tor-commits mailing list