How does the tor daemon read the GeoIP database file? Does it read the whole file once when starting up, or every time it needs to resolve an IP, or something in between (say, it builds an index in memory on startup and then seeks to locations in the file when looking up)?
I am asking because I want to know if I need to restart, SIGHUP or in some other way kick the daemon after I install a new GeoIP file into place.
On Sun, May 07, 2017 at 08:20:39PM -0700, Ian Zimmerman wrote:
How does the tor daemon read the GeoIP database file? Does it read the whole file once when starting up, or every time it needs to resolve an IP, or something in between (say, it builds an index in memory on startup and then seeks to locations in the file when looking up)?
It reads it once on startup, and keeps it in memory after that.
I am asking because I want to know if I need to restart, SIGHUP or in some other way kick the daemon after I install a new GeoIP file into place.
It looks like you need to restart -- a hup won't do it.
I just filed https://bugs.torproject.org/22203 for maybe making a hup do what you wanted, but it turns out to be complicated, so don't hold your breath. :)
What are you doing, that needs changes to the geoip file of a running Tor daemon?
--Roger
On 2017-05-08 20:07, Roger Dingledine wrote:
What are you doing, that needs changes to the geoip file of a running Tor daemon?
There is fresh geoip data posted on maxmind.com monthly. Doesn't it make sense to have the daemon use it?
On 9 May 2017, at 13:35, Ian Zimmerman itz@primate.net wrote:
On 2017-05-08 20:07, Roger Dingledine wrote:
What are you doing, that needs changes to the geoip file of a running Tor daemon?
There is fresh geoip data posted on maxmind.com monthly. Doesn't it make sense to have the daemon use it?
No, we process the file, and update it when we do a release. And at that point, the tor daemon is restarted anyway.
GeoIP is not that accurate anyway, particularly for servers. So there's no need to have it updated every month rather than every release.
Also, if tor retrieved the file from maxmind.com directly, that could cause all sorts of load, privacy, and security issues.
T -- Tim Wilson-Brown (teor)
teor2345 at gmail dot com PGP C855 6CED 5D90 A0C5 29F6 4D43 450C BA7F 968F 094B ricochet:ekmygaiu4rzgsk6n xmpp: teor at torproject dot org ------------------------------------------------------------------------
On Thu, Jun 29, 2017 at 11:49:58AM +1000, teor wrote:
There is fresh geoip data posted on maxmind.com monthly. Doesn't it make sense to have the daemon use it?
No, we process the file, and update it when we do a release. And at that point, the tor daemon is restarted anyway.
GeoIP is not that accurate anyway, particularly for servers. So there's no need to have it updated every month rather than every release.
Also, having relays and clients not splintering the anonymity sets could be smart. If everybody has a slightly different geoip file, especially if only a few people have some of the differences, that could be bad news. For an example, say there's a country that had no entries last month, but now has a few entries, and only a few relays switch to the new geoip file, and there's a user who connects from that address block.
We already have things splintered by Tor releases, but at least there aren't that many of them, and most relays are on one of a handful of versions.
Also, if tor retrieved the file from maxmind.com directly, that could cause all sorts of load, privacy, and security issues.
That design (well, retrieving from the directory authorities, not from maxmind) was actually one that we considered:
https://gitweb.torproject.org/torspec.git/tree/proposals/126-geoip-reporting...
--Roger
tor-relays@lists.torproject.org