geoipupdate
geoipupdate copied to clipboard
Exit status code
This command doesn't appear to have a differing status code, depending on if it updated the database(s) or not. It would be good to return something different so a cron job statement could chain restarting services ONLY if the databases were updated.
Yeah, this would be great, something like geoipupdate -e && nginx -s reload.
It should be an explicit option like -e --exit to not break existing scripts.
Yes, i think this feature is necessary!
I don't think this is a good idea, by multiple reasons:
-
If there are multiple databases configured for update, it is not clear which one got an update and which one is used by the process to be reloaded. Probably there are multiple processes using different databases.
-
In large deployments, the update may be run on a few hosts only, which then distribute the database files to many different systems and services. These could not be notified this way.
-
The usual interpretation of exit status is, that 0 denotes a successful, while anything else an abnormal termination.
Therefore, the approach of having processes subscribed via inotify to file changes is more reasonable and fine grained.
On the other hand, distinct error codes for different errors would make sense, e.g. for an invalid license key there should be a different exit status as for a probably temporal network connection issue. This could allow the implementation of retry mechanisms around the update tool.