简体   繁体   English

Tor Win32服务无法启动

[英]Tor Win32 Service doesn't start

I have a Windows service named Tor Win32 Service that was installed by the Tor installer today but does not start. 我有一个名为Tor Win32 Service的Windows服务,该服务今天已由Tor安装程序安装,但无法启动。 I get the message Windows could not start the Tor Win32 Service service on Local Computer. 我收到消息Windows无法在本地计算机上启动Tor Win32 Service服务。 Error 1064: An exception occurred in the service when handling the control request. 错误1064:处理控制请求时服务中发生了异常。 The service is installed with this path to the executable 该服务通过此可执行文件路径安装

"E:\...\tor browser\browser\torbrowser\tor\tor.exe" --nt-service "-f" "e:\...\tor browser\browser\torbrowser\data\tor\torrc"

This post https://tor.stackexchange.com/questions/15207/problems-with-starting-the-tor-service-on-windows-10-error-1064 suggests that the problem (when running the service for a Tor relay) is the log file path in torrc . 这篇文章https://tor.stackexchange.com/questions/15207/problems-with-starting-the-tor-service-on-windows-10-error-1064提出了这个问题(在为Tor中继运行服务时)是torrc的日志文件路径。 But (a) I fixed that and it did not solve the problem and (b) I don't want to run a Tor relay anyway, I need the service to provide a proxy for my Python program. 但是(a)我解决了该问题,但并不能解决问题,并且(b)无论如何我都不想运行Tor中继,我需要该服务为我的Python程序提供代理。

Running into a similar issue on Windows 7 and Windows 10 using TorBrowser 8.0.2_en_US. 使用TorBrowser 8.0.2_en_US在Windows 7和Windows 10上遇到类似问题。

I usually solve it with starting Tor Browser itself even if I am not intending to use it. 我通常通过启动Tor浏览器本身来解决它,即使我不打算使用它。 It seems to impact Error 1064. 它似乎会影响错误1064。

The change I see is that despite having "ControlPort 9051" in the torcc file running netstat -an in the command prompt does not show port 9051 as listening or established unless I start Tor Browser itself. 我看到的变化是,尽管在命令提示符下运行netstat -an的torcc文件中具有“ ControlPort 9051”,但除非我启动Tor浏览器本身,否则不会将端口9051显示为正在侦听或建立。 Running code cold in python with the correct settings for Chrome or Firefox never works. 使用适用于Chrome或Firefox的正确设置在python中冷运行代码是行不通的。

Other issue that I've ran into with the same error code is that Tor might not be running as a service or is stopped. 我遇到过相同错误代码的另一个问题是Tor可能未作为服务运行或已停止。 Win+R and services.msc should show it running. Win + R和services.msc应该显示它正在运行。

If not install it via the command prompt (run as administrator) and type sc create "Tor Win32 Service" binPath= "\\"C:\\xxxxxxxx\\Tor\\tor.exe\\" --nt-service -f \\"C:/xxxxxxxx/Data/Tor/torrc\\"". 如果没有通过命令提示符(以管理员身份运行)安装它,然后键入sc create“ Tor Win32 Service” binPath =“” \\“ C:\\ xxxxxxxx \\ Tor \\ tor.exe \\” --nt-service -f \\“ C: / XXXXXXXX /数据/符/的torrc \\ “”。 If it is already listed in the services might be good to delete it via sc delete "Tor Win32 Service" and reinstall. 如果服务中已列出该文件,则最好通过sc删除它,然后删除“ Tor Win32 Service”并重新安装。

You can run Tor not as a service (without --nt-service ) inside your python application and pass your custom torrc, using -f <config> parameter. 您可以使用-f <config>参数在Python应用程序--nt-service Tor不作为服务运行(不带--nt-service ),并传递自定义torrc。 It's useful if you want to change listening port. 如果您想更改监听端口,则很有用。 You can use --hash-password <PASSWORD> parameter to prevent another applications to access your tor proxy. 您可以使用--hash-password <PASSWORD>参数来防止其他应用程序访问您的Tor代理。

I raised a ticket at the Tor project about this and got the following response: 我在Tor项目上为此举了一张票,得到了以下回应:

Tor we ship in Tor Browser is not to be meant to be a standalone Tor. 我们在Tor浏览器中提供的Tor并不意味着是独立的Tor。 If you want to have a standalone Tor on Windows please use the expert bundle https://www.torproject.org/dist/torbrowser/7.0.11/tor-win32-0.3.1.9.zip 如果要在Windows上使用独立的Tor,请使用专家包https://www.torproject.org/dist/torbrowser/7.0.11/tor-win32-0.3.1.9.zip

So I took the advice and downloaded the recommended package and the tor.exe in that package works perfectly, both from the command line and as a service. 所以我把建议和下载推荐的包和tor.exe包完美的作品,无论是从命令行和作为服务。

AN's comment/question "is it the correct Tor executable?" AN的评论/问题“它是正确的Tor可执行文件吗?” was right on the money, though I didn't read that until after I had solved the problem. 钱是对的,尽管直到解决问题后我才读过。 And until then I wouldn't have known how to answer it. 在那之前,我还不知道如何回答。 ("Is it the correct executable? How would I know? How is one supposed to tell? The one I have won't even tell me what version it is.") (“它是正确的可执行文件吗?我怎么知道?应该怎么说?我什至不告诉我它是什么版本。”)

It is a puzzle to me that the Tor Browser bundle contains a program called tor.exe , and installs it as a service, when the file is not meant to be a program you can actually run. 让我感到困惑的是,Tor浏览器捆绑包包含一个名为tor.exe的程序,并将其安装为服务,而该文件并不意味着您可以实际运行。 I do realize that .exe files are not always really executable, and can be simply repositories of binary resources. 我确实意识到.exe文件并非总是真正可执行的,而可以只是二进制资源的存储库。 But you don't install such files as services. 但是,您不会安装诸如服务之类的文件。 Having two files called tor.exe , one which is meant to be executed and the other not, does strike me as unnecessarily obscure. 有两个名为tor.exe文件,一个文件打算执行,另一个文件不执行,这确实使我感到不必要。

Just open services.msc right click on Tor Win32 Service, then properties, navigate to the Log On tab and click local system account. 只需打开services.msc,右键单击Tor Win32 Service,然后单击属性,导航到“登录”选项卡,然后单击“本地系统帐户”。 Hit apply. 点击申请。 Done 完成

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM