maxmind / geoipupdate-legacy

GeoIP update client code
GNU General Public License v2.0
258 stars 63 forks source link

Return code for "no updates requires" should not be 1 #65

Closed asfaltboy closed 7 years ago

asfaltboy commented 7 years ago

I'm using, GeoIP version 1.5.0-11.el7 from centos 7 base repo, but this may be true for other versions.

[user@my_instance]# /bin/geoipupdate
MD5 Digest of installed database is 9bd9e09797f062ad1b2c6d7bb304141c
/usr/share/GeoIP/GeoLiteCountry.dat is up to date, no updates required
GeoIP Database up to date
MD5 Digest of installed database is 4a9ee59d8621705acb0be340a01b8cf6
/usr/share/GeoIP/GeoLiteCity.dat is up to date, no updates required
GeoIP Database up to date
[user@my_instance]# echo $?
1

The man page mentions:

RETURN CODES
       geoipupdate returns 0 on success, 1 on error.

This sort of hurts our attempts to get notified in case geoipupdate fails abnormally. Normally, successful execution, even if nothing was modified, should return 0. Alternatively, we can return a custom code (e.g 2) which will allow users to check for an "unmodified db" or actual errors.

asfaltboy commented 7 years ago

Ok, this source actually doesn't have this issue, and I see the problem is that the base version of GeoIP for RHEL 7 is still 1.5. It's been mentioned here: https://bugzilla.redhat.com/show_bug.cgi?id=1295795 but no-one seems to have acted on it. I'm not sure who maintains the RHEL package, but it certainly looks like it's time for an update.

oschwald commented 7 years ago

I am going to close this as it is no longer an issue in newer releases. You would need to talk to the Red Hat people about getting a newer version in RHEL 7.