Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3148 closed defect (fixed)

Tor listen socks closed after tor is loaded

Reported by: zynox Owned by:
Priority: Medium Milestone:
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I have my tor configured to listen both as a relay and a socks client, but it never listens on these ports. lsof shows it doesn't listen at all. I used strace to check if the sockets were ever being created and I found they were. But later they are closed, I cannot find any reason for this. (file descriptors 7 and 8). They are closed after some DNS lookup for my own hostname. This is version 0.2.1.30 on arch linux.

Here is the output of strace:

write(1, "May 12 !02:46:10.249 [notice] Ope"..., 65May 12 !02:46:10.249 [notice] Opening OR listener on !0.0.0.0:9001) = 65socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 7setsockopt(7, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0bind(7, {sa_family=AF_INET, sin_port=htons(9001), sin_addr=inet_addr("0.0.0.0")}, 16) = 0listen(7, 128) = 0fcntl(7, F_SETFL, O_RDONLY|O_NONBLOCK) = 0epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN, {u32=7, u64=7}}) = 0write(1, "May 12 !02:46:10.250 [notice] Ope"..., 70May 12 !02:46:10.250 [notice] Opening Socks listener on !127.0.0.1:9050) = 70socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 8setsockopt(8, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0bind(8, {sa_family=AF_INET, sin_port=htons(9050), sin_addr=inet_addr("127.0.0.1")}, 16) = 0listen(8, 128) = 0fcntl(8, F_SETFL, O_RDONLY|O_NONBLOCK) = 0epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN, {u32=8, u64=8}}) = 0...open("/etc/hosts", O_RDONLY|O_CLOEXEC) = 14fstat(14, {st_mode=S_IFREG|0644, st_size=275, ...}) = 0mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0f2bb5c000read(14, "#\n# /etc/hosts: static lookup ta"..., 4096) = 275read(14, "", 4096) = 0close(14) = 0munmap(0x7f0f2bb5c000, 4096) = 0socket(PF_INET, SOCK_DGRAM|SOCK_NONBLOCK, IPPROTO_IP) = 14connect(14, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("172.16.0.23")}, 16) = 0poll([{fd=14, events=POLLOUT}], 1, 0) = 1 ([{fd=14, revents=POLLOUT}])sendto(14, "\346]\1\0\0\1\0\0\0\0\0\0\5hydra\10\3org\0"..., 36, MSG_NOSIGNAL, NULL, 0) = 36poll([{fd=14, events=POLLIN}], 1, 5000) = 1 ([{fd=14, revents=POLLIN}])ioctl(14, FIONREAD, [52]) = 0recvfrom(14, "\346]\201\200\0\1\0\1\0\0\0\0\5hydra\10\3org\0"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("172.16.0.23")}, [16]) = 52close(14) = 0epoll_ctl(3, EPOLL_CTL_DEL, 7, {EPOLLIN, {u32=7, u64=7}}) = 0close(7) = 0epoll_ctl(3, EPOLL_CTL_DEL, 8, {EPOLLIN, {u32=8, u64=8}}) = 0close(8) = 0open("/var/lib/tor/state.tmp", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 7write(7, "# Tor state file last generated "..., 2905) = 2905close(7) = 0rename("/var/lib/tor/state.tmp", "/var/lib/tor/state") = 0

Child Tickets

Attachments (1)

tor.txt (15.3 KB) - added by zynox 9 years ago.
Output of strace

Download all attachments as: .zip

Change History (6)

comment:1 Changed 9 years ago by nickm

What's in your configuration?

Changed 9 years ago by zynox

Attachment: tor.txt added

Output of strace

comment:2 Changed 9 years ago by zynox

Here is everything in my config (except the comments):

SocksPort 9050
SocksBindAddress 127.0.0.1
AllowUnverifiedNodes middle,rendezvous
Log notice syslog
RunAsDaemon 1
User tor
Group tor
DataDirectory /var/lib/tor
HiddenServiceDir /var/lib/tor/inspircd/
HiddenServicePort 6697 127.0.0.1:6697
Nickname hydra
Address hydra.sector5d.org
ContactInfo zynox <zynox AT sector5d.org>
ORPort 9001
ExitPolicy accept *:6697,reject *:*
AccountingStart month 1 00:00
AccountingMax 8 GB

comment:3 Changed 9 years ago by zynox

Resolution: fixed
Status: newclosed

It appears that I found the cause of the of this issue, which is the accounting. I will change this to daily/hourly.

comment:4 Changed 7 years ago by nickm

Keywords: tor-client added

comment:5 Changed 7 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.