[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

NT Service installation does not handle "-f" flag



Just wanted to throw this out and see if I'm missing something obvious before I file a bug report.

I'm trying to install Tor as an NT Service using a custom location for the torrc. I can test whether Tor is using my custom torrc or default values by trying to connect through the ControlPort I configured. I figured I could do so with either one of the following commands:

tor --service install -f "C:\CustomLocation\torrc"
tor -install -f "C:\CustomLocation\torrc"

And when I do this I indeed get the following messages, as well as seeing a tor.exe in the Task Manager:

Done with CreateService.
Service installed successfully
Service started successfully
[warn] Failed to parse/validate config: Unknown option 'service'. Failing.
[err] Reading config failed--see warnings above.

However, being unable to connect to the ControlPort, I suspect that the service is ignoring my "-f" option and using the default location for the torrc, and clearly not finding it. This is made clear when I restart the service on the command line and receive the following:

[notice] Configuration file "C:\Documents and Settings\MyUserName\Application Data\tor\torrc" not present, using reasonable defaults. [warn] Failed to parse/validate config: Unknown option 'service'. Failing.
[err] Reading config failed--see warnings above.

Despite these errors, a tor.exe can be seen plugging along quite happily in the Task Manager. There seem to be two issues here. The first is that the service installation is not incorporating command-line flags into the start parameters of the service, forcing it to revert to defaults. The second (and I'm speculating here) is that Tor is not exiting cleanly after it invokes CreateService and/or ControlService, causing the log warnings. I have no idea if this second issue is a big deal or not.

For the record, there are no issues with Tor itself running as a service, as the following command works perfectly on the command-line. But I need it running in the pre-logon environment and across user sessions, so unless I can get my custom flags to take, I'm looking at mucking around with NTFS symlinks, which is really more than I want to deal with today.

tor --nt-service -f "C:\CustomLocation\torrc"

Thoughts?

~Justin Aplin