mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 15:43:32 +01:00
make pidfile default to null rather than writing to your cwd
svn:r853
This commit is contained in:
parent
4565150db2
commit
d6601f8cff
@ -259,7 +259,7 @@ void init_options(or_options_t *options) {
|
||||
options->DirBindAddress = tor_strdup("0.0.0.0");
|
||||
options->RecommendedVersions = tor_strdup("none");
|
||||
options->loglevel = LOG_INFO;
|
||||
options->PidFile = tor_strdup("tor.pid");
|
||||
options->PidFile = NULL; // tor_strdup("tor.pid");
|
||||
options->DataDirectory = NULL;
|
||||
options->PathlenCoinWeight = 0.3;
|
||||
options->MaxConn = 900;
|
||||
|
@ -628,8 +628,8 @@ static int init_from_config(int argc, char **argv) {
|
||||
}
|
||||
|
||||
/* write our pid to the pid file, if we do not have write permissions we will log a warning */
|
||||
if(options.PidFile)
|
||||
write_pidfile(options.PidFile);
|
||||
/* XXX Is overwriting the pidfile ok? I think it is. -RD */
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -750,6 +750,7 @@ static void catch(int the_signal) {
|
||||
log(LOG_ERR,"Catching signal %d, exiting cleanly.", the_signal);
|
||||
/* we don't care if there was an error when we unlink, nothing
|
||||
we could do about it anyways */
|
||||
if(options.PidFile)
|
||||
unlink(options.PidFile);
|
||||
exit(0);
|
||||
case SIGHUP:
|
||||
|
Loading…
Reference in New Issue
Block a user