Tor listen socks closed after tor is loaded
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 !2 (merged):46:10.249 [notice] Ope"..., 65May 12 !2 (merged):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 !2 (merged):46:10.250 [notice] Ope"..., 70May 12 !2 (merged):46:10.250 [notice] Opening Socks listener on !127 (merged).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
Trac:
Username: zynox