Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 471422 - dev-libs/geoip - geoipupdate.sh does not update USE="city" databases
Summary: dev-libs/geoip - geoipupdate.sh does not update USE="city" databases
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-27 12:27 UTC by Philippe Chaintreuil
Modified: 2014-04-29 14:44 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Chaintreuil 2013-05-27 12:27:07 UTC
The geoipupdate.sh script does not update the GeoLiteCity.dat & GeoLiteCityv6.dat because they are renamed to replace "GeoLiteCity" with "GeoIPCity" during the install.  The rename creates a disconnect between URL filename and on disk filename that confuses the update script.

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-05-27 16:06:06 UTC
I thought we'd already fixed this one.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-05-27 16:08:00 UTC
Maybe this changed things?
Comment 3 Philippe Chaintreuil 2013-05-27 17:10:14 UTC
Looks like the fix to the referenced bug #455340 added support for downloading GeoLiteCity*.dat files and renaming them to GeoIPCity*.dat during install via the ebuild.

The shell script that gets installed though is willing to update GeoLite*.dat files, but doesn't know that GeoIPCity*.dat files need to be downloaded as GeoLiteCity*.dat.  A fresh install with USE="city" therefore will download the latest city database(s), rename them, and install them.  But the script won't update them ever because it's looking for the URL/download name, not the on-disk name.

If the rename didn't happen in the ebuild it wouldn't be an issue, but I'm assuming that was done for good reason....
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2013-05-28 05:49:48 UTC
BTW: dev-libs/geoip-1.5.0 introduced a new updater from MaxMind. Shouldn't we drop support of geoipupdate.sh in favor of the new /usr/bin/geoipupdate from upstream?
Comment 5 Philippe Chaintreuil 2013-05-28 14:26:26 UTC
(In reply to Thomas D. from comment #4)
> BTW: dev-libs/geoip-1.5.0 introduced a new updater from MaxMind. Shouldn't
> we drop support of geoipupdate.sh in favor of the new /usr/bin/geoipupdate
> from upstream?

Does the new updater run for unlicensed users?
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2013-05-28 14:32:50 UTC
(In reply to Philippe Chaintreuil from comment #5)
> (In reply to Thomas D. from comment #4)
> > BTW: dev-libs/geoip-1.5.0 introduced a new updater from MaxMind. Shouldn't
> > we drop support of geoipupdate.sh in favor of the new /usr/bin/geoipupdate
> > from upstream?
> 
> Does the new updater run for unlicensed users?

I tried that. First you need to set up /etc/GeoIP.conf for unlicensed use, and then it still bugs out because the Product ID doesn't match.
Comment 7 Thomas Deutschmann (RETIRED) gentoo-dev 2013-05-28 14:56:22 UTC
(In reply to Jeroen Roovers from comment #6)
> > Does the new updater run for unlicensed users?
> 
> I tried that. First you need to set up /etc/GeoIP.conf for unlicensed use,
> and then it still bugs out because the Product ID doesn't match.

You need the right IDs. From Readme:

> Put this into the config file /usr/local/etc/GeoIP.conf
> to download the free GeoLite databases GeoLiteCountry, GeoLiteCity and
> GeoLiteASNum
> 
> LicenseKey 000000000000
> UserId 999999
> ProductIds 506 533 517
> 
> Free users should create symlinks for the GeoIP databases.
> For example:
> 
> cd /usr/local/share/GeoIP
> ln -s GeoLiteCity.dat GeoIPCity.dat
> ln -s GeoLiteCountry.dat GeoIPCountry.dat
> ln -s GeoLiteASNum.dat GeoIPASNum.dat

I just don't know the product id for GeoIPv6.dat right now.
Comment 8 Philippe Chaintreuil 2013-05-28 15:36:35 UTC
As a footnote, with Thomas's settings GeoLiteCountry.dat is downloaded, but following the "ln -s GeoLiteCountry.dat GeoIPCountry.dat" instructions doesn't work (the other two do); I assume the command should be "ln -s GeoLiteCountry.dat GeoIP.dat" (works for me).
Comment 9 Thomas Deutschmann (RETIRED) gentoo-dev 2013-05-28 16:31:16 UTC
(In reply to Philippe Chaintreuil from comment #8)
> As a footnote, with Thomas's settings GeoLiteCountry.dat is downloaded, but
> following the "ln -s GeoLiteCountry.dat GeoIPCountry.dat" instructions
> doesn't work (the other two do); I assume the command should be "ln -s
> GeoLiteCountry.dat GeoIP.dat" (works for me).

Not sure about your problem:

> vm-gentoo-x64 GeoIP # cat /etc/GeoIP.conf 
> LicenseKey 000000000000
> UserId 999999
> ProductIds 506 533 517
> 
> vm-gentoo-x64 GeoIP # pwd
> /usr/share/GeoIP
> GeoIP # ls -l
> total 0
> vm-gentoo-x64 GeoIP # geoipupdate
> /usr/share/GeoIP/GeoLiteCountry.dat can't be opened, proceeding to download database
> Updating /usr/share/GeoIP/GeoLiteCountry.dat
> Updated database
> /usr/share/GeoIP/GeoLiteCity.dat can't be opened, proceeding to download database
> Updating /usr/share/GeoIP/GeoLiteCity.dat
> Updated database
> /usr/share/GeoIP/GeoLiteASNum.dat can't be opened, proceeding to download database
> Updating /usr/share/GeoIP/GeoLiteASNum.dat
> Updated database
> vm-gentoo-x64 GeoIP # ls -l
> total 22588
> -rw-r--r-- 1 root root  3428369 May 28 18:20 GeoLiteASNum.dat
> -rw-r--r-- 1 root root 18393569 May 28 18:20 GeoLiteCity.dat
> -rw-r--r-- 1 root root  1301452 May 28 18:20 GeoLiteCountry.dat
> vm-gentoo-x64 GeoIP # ln -s GeoLiteCity.dat GeoIPCity.dat
> vm-gentoo-x64 GeoIP # ln -s GeoLiteCountry.dat GeoIPCountry.dat
> vm-gentoo-x64 GeoIP # ln -s GeoLiteASNum.dat GeoIPASNum.dat
> vm-gentoo-x64 GeoIP # ls -l
> total 22588
> lrwxrwxrwx 1 root root       16 May 28 18:21 GeoIPASNum.dat -> GeoLiteASNum.dat
> lrwxrwxrwx 1 root root       15 May 28 18:21 GeoIPCity.dat -> GeoLiteCity.dat
> lrwxrwxrwx 1 root root       18 May 28 18:21 GeoIPCountry.dat -> GeoLiteCountry.dat
> -rw-r--r-- 1 root root  3428369 May 28 18:20 GeoLiteASNum.dat
> -rw-r--r-- 1 root root 18393569 May 28 18:20 GeoLiteCity.dat
> -rw-r--r-- 1 root root  1301452 May 28 18:20 GeoLiteCountry.dat
vm-gentoo-x64 GeoIP # 


Anyway, seems like the updater doesn't support the IPv6 databases (I checked ID 1-999). I'll contact MaxMind's support, maybe they can help.
Comment 10 Philippe Chaintreuil 2013-05-28 17:00:38 UTC
Thomas, what's the output from "geoiplookup -v gentoo.org"?  Does it list all three databases?
Comment 11 Thomas Deutschmann (RETIRED) gentoo-dev 2013-05-28 17:24:10 UTC
(In reply to Philippe Chaintreuil from comment #10)
> Thomas, what's the output from "geoiplookup -v gentoo.org"?  Does it list
> all three databases?

Ah OK, now I understand.

Yes, you are right. Seems like geoiplookup doesn't know "GeoIPCountry.dat" - there need to be an additional symlink "GeoIPCountry.dat -> GeoIP.dat".
Comment 12 Philippe Chaintreuil 2013-08-24 01:38:27 UTC
(In reply to Thomas D. from comment #9)
> Anyway, seems like the updater doesn't support the IPv6 databases (I checked
> ID 1-999). I'll contact MaxMind's support, maybe they can help.

Thomas -- did you ever hear back abot an ID for GeoIPv6.dat from MaxMind?
Comment 13 Thomas Deutschmann (RETIRED) gentoo-dev 2013-08-24 08:29:55 UTC
Well, MaxMind told me in Mai 2013, that their tool doesn't support updating the free IPv6 database. No answer if they plan to add support in future or not.
Comment 14 Jeroen Roovers (RETIRED) gentoo-dev 2014-04-29 14:44:11 UTC
It's been a year and recently I haven't seen any problems with either Gentoo's update script (which dev-libs/geoip installs) or with net-misc/geoipupdate (which you need to update the licensed, restricted databases).

Assumed fixed.