diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-11-19 11:59:26 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-11-19 11:59:26 +0100 |
commit | 4488281069759ab1a231411e1da23ee90c57ee5a (patch) | |
tree | 2f6defa423c1ecfd8b884e048580079fdddf4004 /cpp/src/IceGrid/ServerI.cpp | |
parent | Added LMDB nuget package to IceDB Makefile.mak (diff) | |
download | ice-4488281069759ab1a231411e1da23ee90c57ee5a.tar.bz2 ice-4488281069759ab1a231411e1da23ee90c57ee5a.tar.xz ice-4488281069759ab1a231411e1da23ee90c57ee5a.zip |
Fixed ICE-6889 - Added support for server.data and service.data variables
Diffstat (limited to 'cpp/src/IceGrid/ServerI.cpp')
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index b5da40d73a1..4a009862139 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -2309,13 +2309,15 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor) IcePatch2Internal::createDirectory(_serverDir + "/config"); IcePatch2Internal::createDirectory(_serverDir + "/dbs"); IcePatch2Internal::createDirectory(_serverDir + "/distrib"); + IcePatch2Internal::createDirectory(_serverDir + "/server_data"); + IcePatch2Internal::createDirectory(_serverDir + "/service_data"); // // Create the configuration files, remove the old ones. // { // - // We do not want to esapce the properties if the Ice version is + // We do not want to escape the properties if the Ice version is // previous to Ice 3.3. // Ice::StringSeq knownFiles; @@ -2369,6 +2371,39 @@ ServerI::updateImpl(const InternalServerDescriptorPtr& descriptor) } // + // Update the service data directories if necessary and remove the old ones. + // + if(_desc->services) + { + Ice::StringSeq knownDirs; + for(Ice::StringSeq::const_iterator q = _desc->services->begin(); q != _desc->services->end(); ++q) + { + knownDirs.push_back(*q); + IcePatch2Internal::createDirectory(_serverDir + "/service_data/" + *q); + } + sort(knownDirs.begin(), knownDirs.end()); + + // + // Remove old directories + // + Ice::StringSeq dirs = IcePatch2Internal::readDirectory(_serverDir + "/service_data"); + Ice::StringSeq toDel; + set_difference(dirs.begin(), dirs.end(), knownDirs.begin(), knownDirs.end(), back_inserter(toDel)); + for(Ice::StringSeq::const_iterator p = toDel.begin(); p != toDel.end(); ++p) + { + try + { + IcePatch2Internal::removeRecursive(_serverDir + "/service_data/" + *p); + } + catch(const string& msg) + { + Ice::Warning out(_node->getTraceLevels()->logger); + out << "couldn't remove directory `" + _serverDir + "/service_data/" + *p + "':\n" + msg; + } + } + } + + // // Update the database environments if necessary and remove the // old ones. // |