Open amzhughe opened 4 years ago
Yeah, it'd be ideal to delete the file. It's that way currently to avoid race conditions. It might be possible to do it, but we'll have to be careful to consider races.
Could you expand a bit more on your use case? The lock file uses the database directory by default. Both users would need to be able to write to that directory for the database downloads to work.
Perhaps it would make sense for us to have a configuration option to set the access permissions on the files created by geoipupdate
.
The
LocalFileDatabaseWriter
'sClose()
method releases the lock file when finished, but doesn't erase it. This lead to an issue where if a different user tries to run the updater, they don't have permission to access the lock file.https://github.com/maxmind/geoipupdate/blob/master/pkg/geoipupdate/database/local_file_writer.go#L96