Tor fails to bind to socket, SOCK_CLOEXEC unsupported on 2.6.18 kernel
When I start Tor I get this error.
Feb 13 21:06:55.032 [notice] Tor v0.2.3.12-alpha (git-800942b4176ca31c) running on Linux i686. Feb 13 21:06:55.032 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning Feb 13 21:06:55.032 [notice] This version is not a stable Tor release. Expect more bugs than usual. Feb 13 21:06:55.032 [warn] This copy of Tor was compiled to run in a non-anonymous mode. It will provide NO ANONYMITY. Feb 13 21:06:55.032 [notice] Read configuration file "/usr/local/etc/tor/torrc". Feb 13 21:06:55.036 [notice] Wow! I detected that you have 24 CPUs. I will not autodetect any more than 16, though. If you want to configure more, set NumCPUs in your torrc Feb 13 21:06:55.036 [notice] Initialized libevent version 2.0.10-stable using method epoll (with changelist). Good. Feb 13 21:06:55.036 [notice] Opening Socks listener on 127.0.0.1:9050 Feb 13 21:06:55.036 [warn] Socket creation failed: Invalid argument Feb 13 21:06:55.036 [warn] Failed to parse/validate config: Failed to bind one of the listener ports. Feb 13 21:06:55.036 [err] Reading config failed--see warnings above.
Running Tor in strace shows the error. [pid 6100] socket(PF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_TCP) = -1 EINVAL (Invalid argument)
From googling the problem appears to be the use of SOCK_CLOEXEC which is not supported by my kernel. Linux kernel 2.6.18 is still used by many distros with active support, such as RHEL/CentOS 5, gentoo.
My specific case is I am trying to get it working on an OpenVZ gentoo vps using kernel vz22915 2.6.18-028stab056-aufs-teak-rin1.
Tor 0.2.2.35 works fine.
Trac:
Username: fob