Hi, the most recent times I have tried to restart Tor after a 'killall -INT' I have been presented with the following error: "[warn] Could not bind to 0.0.0.0:9001: Address already in use. Is Tor already running?" I'm not sure if this has started since I changed version, I'm on Tor 0.2.2.22-alpha (git-e5e38e55b33b2cc0) OSX 10.3.9 . Anyone else see this? How do I release that port? Command 'lsof -i' returns no results, so I don't see Tor is really using it still - no sign of Tor in command 'ps -aux' output.
Update: after running those commands, Tor was able to start. Why the delay? Is this normal?
TIA GD
On Thu, 31 Mar 2011, Geoff Down wrote:
the most recent times I have tried to restart Tor after a 'killall -INT' I have been presented with the following error: "[warn] Could not bind to 0.0.0.0:9001: Address already in use. Is Tor already running?" I'm not sure if this has started since I changed version, I'm on Tor 0.2.2.22-alpha (git-e5e38e55b33b2cc0) OSX 10.3.9 . Anyone else see this? How do I release that port? Command 'lsof -i' returns no results, so I don't see Tor is really using it still - no sign of Tor in command 'ps -aux' output.
Update: after running those commands, Tor was able to start. Why the delay? Is this normal?
It can take up to a minute or so for the tor process to close its many many open sockets. This is normal, though not all linux distributions init scripts deal with this use case properly.
Paul
On 03/31/2011 09:06 AM, Paul Wouters wrote:
On Thu, 31 Mar 2011, Geoff Down wrote:
the most recent times I have tried to restart Tor after a 'killall -INT' I have been presented with the following error: "[warn] Could not bind to 0.0.0.0:9001: Address already in use. Is Tor already running?" I'm not sure if this has started since I changed version, I'm on Tor 0.2.2.22-alpha (git-e5e38e55b33b2cc0) OSX 10.3.9 . Anyone else see this? How do I release that port? Command 'lsof -i' returns no results, so I don't see Tor is really using it still - no sign of Tor in command 'ps -aux' output.
Update: after running those commands, Tor was able to start. Why the delay? Is this normal?
It can take up to a minute or so for the tor process to close its many many open sockets.
By default Tor takes 30 seconds before it really exits, you can modify this "timeout" by specifying ShutdownWaitLength in your torrc.
from the manpage:
ShutdownWaitLength NUM When we get a SIGINT and we’re a server, we begin shutting down: we close listeners and start refusing new circuits. After NUM seconds, we exit. If we get a second SIGINT, we exit immediately. (Default: 30 seconds)
On Thu, 31 Mar 2011 09:58 +0200, "tagnaq" tagnaq@gmail.com wrote:
On 03/31/2011 09:06 AM, Paul Wouters wrote:
On Thu, 31 Mar 2011, Geoff Down wrote:
the most recent times I have tried to restart Tor after a 'killall -INT' I have been presented with the following error: "[warn] Could not bind to 0.0.0.0:9001: Address already in use. Is Tor already running?" I'm not sure if this has started since I changed version, I'm on Tor 0.2.2.22-alpha (git-e5e38e55b33b2cc0) OSX 10.3.9 . Anyone else see this? How do I release that port? Command 'lsof -i' returns no results, so I don't see Tor is really using it still - no sign of Tor in command 'ps -aux' output.
Update: after running those commands, Tor was able to start. Why the delay? Is this normal?
It can take up to a minute or so for the tor process to close its many many open sockets.
By default Tor takes 30 seconds before it really exits, you can modify this "timeout" by specifying ShutdownWaitLength in your torrc.
from the manpage:
ShutdownWaitLength NUM When we get a SIGINT and we’re a server, we begin shutting down: we close listeners and start refusing new circuits. After NUM seconds, we exit. If we get a second SIGINT, we exit immediately. (Default: 30 seconds)
Yes, this was after the 30 second wait and tor disappearing from a list of running processes - but thank you both anyway. GD
On Thu, Mar 31, 2011 at 11:55:22AM +0100, Geoff Down wrote:
Yes, this was after the 30 second wait and tor disappearing from a list of running processes - but thank you both anyway.
Hmm, what you're describing sounds like SO_REUSEADDR problems, but tor sets that correctly on its sockets AFAICS.
-andy
On Thu, Mar 31, 2011 at 11:55:22AM +0100, Geoff Down wrote:
the most recent times I have tried to restart Tor after a 'killall -INT' I have been presented with the following error: "[warn] Could not bind to 0.0.0.0:9001: Address already in use. Is Tor already running?"
Update: after running those commands, Tor was able to start. Why the delay? Is this normal?
By default Tor takes 30 seconds before it really exits, you can modify this "timeout" by specifying ShutdownWaitLength in your torrc.
Yes, this was after the 30 second wait and tor disappearing from a list of running processes - but thank you both anyway.
A mystery. My guess is either there's something special about your OS X version, or you're doing it wrong. :)
One approach to debugging further might be to use Tor's PidFile option. Tor will create a file when it starts, and remove the file when it exits cleanly.
You might like Debian's init script for examples of starting and stopping Tor: https://gitweb.torproject.org/debian/tor.git/blob_plain/master:/debian/tor.i...
See e.g. check_torpiddir() and wait_for_deaddaemon().
Hope that helps, --Roger
tor-relays@lists.torproject.org