2016-11-12 38 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 
相關問題