2016-11-12 66 views
0

我在Mac Sierra上。我想开始我的Tor的实例,但显然它已经在我的电脑上运行...为什么不是“lsof”告诉我正在运行的进程的PID?

localhost:myproject davea$ tor --CookieAuthentication 0 --HashedControlPassword "" --ControlPort 9050 --SocksPort 50001 
Nov 12 12:27:06.777 [notice] Tor v0.2.8.9 running on Darwin with Libevent 2.0.22-stable, OpenSSL 1.0.2j and Zlib 1.2.8. 
Nov 12 12:27:06.778 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning 
Nov 12 12:27:06.778 [notice] Read configuration file "/opt/local/etc/tor/torrc". 
Nov 12 12:27:06.782 [warn] Linelist option '__HashedControlSessionPassword' has no value. Skipping. 
Nov 12 12:27:06.782 [warn] Option 'CookieAuthentication' used more than once; all but the last value will be ignored. 
Nov 12 12:27:06.782 [warn] Linelist option '__HashedControlSessionPassword' has no value. Skipping. 
Nov 12 12:27:06.782 [warn] ControlPort is open, but no authentication method has been configured. This means that any program on your computer can  reconfigure your Tor. That's bad! You should upgrade your Tor controller as soon as possible. 
Nov 12 12:27:06.783 [notice] Opening Socks listener on 127.0.0.1:50001 
Nov 12 12:27:06.783 [notice] Opening Socks listener on 127.0.0.1:50001 
Nov 12 12:27:06.783 [warn] Could not bind to 127.0.0.1:50001: Address already in use. Is Tor already running? 
Nov 12 12:27:06.783 [notice] Opening Control listener on 127.0.0.1:9050 
Nov 12 12:27:06.783 [notice] Opening Control listener on 127.0.0.1:9050 
Nov 12 12:27:06.783 [warn] Could not bind to 127.0.0.1:9050: Address already in use. Is Tor already running? 
Nov 12 12:27:06.783 [notice] Closing partially-constructed Socks listener on 127.0.0.1:50001 
Nov 12 12:27:06.783 [notice] Closing partially-constructed Control listener on 127.0.0.1:9050 
Nov 12 12:27:06.783 [warn] Failed to parse/validate config: Failed to bind one of the listener ports. 
Nov 12 12:27:06.783 [err] Reading config failed--see warnings above. 

我累找出PID是在指定的端口上运行的过程中有什么,但苹果告诉我什么...

localhost:myproject davea$ 
localhost:myproject davea$ 
localhost:myproject davea$ lsof -i :9050 
localhost:myproject davea$ 
localhost:myproject davea$ lsof -i :50001 
localhost:myproject davea$ netstat -anp tcp | grep 50001 
localhost:myproject davea$ netstat -anp tcp | grep 9050 
localhost:myproject davea$ 
localhost:myproject davea$ 

任何想法如何我可以找出什么是PID和杀死它,所以我可以启动Tor?

回答

0

要找出PID使用特定端口:

$ lsof -t -i :9050 

命令你已经表明是正确的,那么你可能要确认是否lsofnetstat做一个更实际的工作通用命令作为测试,例如:

$ lsof -i 

如果仍然不返回任何内容,那么你就会知道问题不是孤立的。根据您的用户权限,您可能需要使用sudo执行lsofnetstat

$ sudo lsof -i -P 

还有的可能性也不返回任何东西,因为端口可能没有真正打开:

Nov 12 12:27:06.783 [notice] Opening Control listener on 127.0.0.1:9050 
Nov 12 12:27:06.783 [notice] Opening Control listener on 127.0.0.1:9050 
Nov 12 12:27:06.783 [warn] Could not bind to 127.0.0.1:9050: Address already in use. Is Tor already running? 
Nov 12 12:27:06.783 [notice] Closing partially-constructed Socks listener on 127.0.0.1:50001 
Nov 12 12:27:06.783 [notice] Closing partially-constructed Control listener on 127.0.0.1:9050 
Nov 12 12:27:06.783 [warn] Failed to parse/validate config: Failed to bind one of the listener ports. 

关闭部分 - 构建127.0.0.1:9050控制监听器

确认是否或者不是tor过程实际上是按照通知运行的:

$ ps ax | grep tor 
相关问题