Opened 7 years ago

Closed 6 years ago

#7715 closed defect (user disappeared)

Tor is not working with the RunAsDaemon option enabled

Reported by: srw Owned by:
Priority: High Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.2.3.25
Severity: Keywords: daemon background tor-relay
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When I run a Tor instance with the RunAsDaemon option enabled it does not work. I tested it with the current stable and alpha releases. I remember this option was working at the time I wrote the http://blog.databigbang.com/distributed-scraping-with-multiple-tor-circuits/ article (December 2, 2011).

If I run it in the following way:
tor --RunAsDaemon 1 --CookieAuthentication 0 --HashedControlPassword "" --ControlPort 8118 --PidFile tor0.pid --SocksPort 9050 --DataDirectory data/tor0

and test it using curl with:
curl -v --socks5 localhost:9050 <url>

It never retrieves the url, but if I run the tor process without RunAsDaemon it works.

Child Tickets

Change History (4)

comment:1 Changed 7 years ago by nickm

Hmm. Is there a logfile? When I tried this, I got a large number of:

Dec 17 02:11:21.000 [warn] Couldn't open "data/tor0/cached-certs.tmp" (data/tor0
/cached-certs) for writing: No such file or directory
Dec 17 02:11:21.000 [warn] Error writing certificates to disk.
Dec 17 02:11:22.000 [warn] Couldn't append to journal in data/tor0/cached-microdescs.new: No such file or directory
Dec 17 02:11:22.000 [warn] Couldn't open "data/tor0/cached-microdescs.new" (data/tor0/cached-microdescs.new) for writing: No such file or directory
Dec 17 02:11:22.000 [warn] Couldn't append to journal in data/tor0/cached-microdescs.new: No such file or directory
Dec 17 02:11:22.000 [warn] Couldn't open "data/tor0/cached-microdescs.new" (data/tor0/cached-microdescs.new) for writing: No such file or directory
Dec 17 02:11:22.000 [warn] Couldn't append to journal in data/tor0/cached-microdescs.new: No such file or directory

and such. I wonder if this has something to do with the fact that there are so many relative paths in the example you give. The RunAsDaemon option involves doing a chdir(). Does switching to absolute paths work? If so, I wonder which commit broke this.

comment:2 Changed 6 years ago by nickm

Milestone: Tor: 0.2.4.x-final
Status: newneeds_information

comment:3 Changed 6 years ago by nickm

Milestone: Tor: 0.2.4.x-finalTor: unspecified

(Can you answer the questions above, or say more about your setup and torrc, or anything? It's hard to try to figure this out with nothing more to go on.)

comment:4 Changed 6 years ago by nickm

Keywords: tor-relay added
Resolution: user disappeared
Status: needs_informationclosed
Note: See TracTickets for help on using tickets.