I have come across two issues while trying to share a GEOSERVER_DATA_DIR between multiple GeoServer instances and they start up at the same time: 1) Multiple instances using IOUtils.xStreamPersist clash as the filename is non-unique. One process starts writing the temp file, the next one comes in and deletes it. I suggest adding a random number to the temp file name to avoid this. This occurs because on every startup the security settings are "upgraded" and re-written.
2) Service XML files are re-written on startup In the start of DefaultGeoserverLoader.loadGeoserver it creates the ServicePersister and adds it as a listener to the GeoServer object. If it adds it as a listener in the finally block (similar to GeoServerPersister) then the file write is avoided. As an aside, should ServicePersister use IOUtils.xStreamPersist to avoid multiple writes clashing?
I have attached the UNIX-style patches (against 1.5.0) which I have tested here. I can provide logs from when the issue occurred if required.
|