-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restart Tor #20
Comments
I honestly haven't the slightest clue what might be wrong, but this is a use case I want to actively use myself too in the following days, so I'll get back to you if I figure anything out. |
Just hit this myself too. Funky, will try to figure it out. Seems that the tor bootstrap never finishes when restarting. At least it never gives back control to the caller, even though it says "100%" booted. I've tried nuking the datadir and restarting like that and it also doesn't seem to work, so it might be something off either in the lib or in the control lib. |
I think the (or an) issue is in the controller lib: https://github.com/cretz/bine/blob/62912bff1c531f4cb731cc86d38e78bc94aea2fd/tor/tor.go#L370 Onion creation uses |
I knew until now that the Tor library is not capable of running two instances in the same process. Unfortunately it also seems that it's not capable of restarting itself without restarting the entire process. My hunch is that some global variable is ruined on shutdown. Either way, Tor does support enabling and siabling networking, so you can get away with not killing the in-process Tor, just shutting the network off and back on and it should work: You can enable networking on request via. tor.EnableNetwork(context.Background(), false) Turning off the networking is not exposed in the tor.Control.SetConf(control.KeyVals("DisableNetwork", "1")...) The lack of the latter is tracked in cretz/bine#41 |
I am using tor and generating onion url and associating it with a http server. Whenever my internet connection is lost the tor circuits break. I want to restart everything at this point. For doing so, i stop my http server and close my onion and tor by tor.Close() and onion.Close(). After that i try to repeat all the process from start to start tor, onion and http service. At this moment i am unable to connect to tor. Everyting context time out occurs.
If i close the program and re-run it seems to work fine. But when i try to restart within the running program it doesnot works.
Is there some issue of tor.Close() or onion.Close()? I am unable to figure this out.
How to restart existing running tor service without stop existing running program?
The text was updated successfully, but these errors were encountered: