Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable proofd file server for XRootD>=5 #178

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmake/modules/RootBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ ROOT_BUILD_OPTION(x11 ON "X11 support")
ROOT_BUILD_OPTION(xft ON "Xft support (X11 antialiased fonts)")
ROOT_BUILD_OPTION(xml ON "XML parser interface")
ROOT_BUILD_OPTION(xrootd ON "Build xrootd file server and its client (if supported)")
ROOT_BUILD_OPTION(xproofd OFF "Enable LEGACY support for XProofD file server and client (requires XRootD v4 with private-devel)")
ROOT_BUILD_OPTION(coverage OFF "Test coverage")

option(fail-on-missing "Fail the configure step if a required external package is missing" OFF)
Expand Down Expand Up @@ -256,6 +257,7 @@ if(all)
set(vc_defvalue ON)
set(vdt_defvalue ON)
set(veccore_defvalue ON)
set(xproofd_defvalue OFF)
endif()

#--- The 'builtin_all' option swithes ON old the built in options-------------------------------
Expand Down
15 changes: 15 additions & 0 deletions cmake/modules/SearchInstalledSoftware.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,21 @@ if(xrootd AND XROOTD_VERSIONNUM VERSION_GREATER 300030005)
else()
set(netxng OFF)
endif()
if(xrootd AND XROOTD_VERSIONNUM VERSION_LESS 500000000)
set(netx ON)
else()
set(netx OFF)
endif()
if(xrootd AND XROOTD_VERSIONNUM VERSION_GREATER_EQUAL 500000000)
if(xproofd)
if(fail-on-missing)
message(FATAL_ERROR "XROOTD is version 5 or greater. The legacy xproofd servers can not be built with this version. Use -Dxproofd:BOOL=OFF to disable.")
else()
message(STATUS "XROOTD is version 5 or greater. The legacy xproofd servers can not be built with this version. Disabling 'xproofd' option.")
set(xproofd OFF CACHE BOOL "Disabled because xrootd version is 5 or greater" FORCE)
endif()
endif()
endif()

#---Alien support----------------------------------------------------------------
if(alien)
Expand Down
2 changes: 1 addition & 1 deletion net/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if(NOT WIN32 AND ssl)
add_subdirectory(rootd)
endif()

if(xrootd)
if(netx)
add_subdirectory(netx)
endif()

Expand Down
18 changes: 17 additions & 1 deletion net/netxng/src/TNetXNGSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@
#include "TVirtualMutex.h"
#include <XrdCl/XrdClFileSystem.hh>
#include <XrdCl/XrdClXRootDResponses.hh>
#include <XrdVersion.hh>
#if XrdVNUMBER >= 40000
#include <XrdNet/XrdNetAddr.hh>
#else
#include <XrdSys/XrdSysDNS.hh>
#endif


////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -352,16 +357,27 @@ Int_t TNetXNGSystem::Locate(const char *path, TString &endurl)
TNamed *hn = 0;
if (fgAddrFQDN.GetSize() <= 0 ||
!(hn = dynamic_cast<TNamed *>(fgAddrFQDN.FindObject(loc)))) {
#if XrdVNUMBER >= 40000
XrdNetAddr netaddr;
netaddr.Set(loc.Data());
const char* name = netaddr.Name();
if (name) {
hn = new TNamed(loc.Data(), name);
} else {
hn = new TNamed(loc, loc);
}
#else
char *addr[1] = {0}, *name[1] = {0};
int naddr = XrdSysDNS::getAddrName(loc.Data(), 1, addr, name);
if (naddr == 1) {
hn = new TNamed(loc.Data(), name[0]);
} else {
hn = new TNamed(loc, loc);
}
fgAddrFQDN.Add(hn);
free(addr[0]);
free(name[0]);
#endif
fgAddrFQDN.Add(hn);
if (gDebug > 0)
Info("Locate","caching host name: %s", hn->GetTitle());
}
Expand Down
2 changes: 1 addition & 1 deletion proof/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif()
if(afdsmgrd)
add_subdirectory(afdsmgrd)
endif()
if(xrootd AND ssl)
if(xproofd AND xrootd AND ssl)
add_subdirectory(proofd)
add_subdirectory(proofx)
endif()
Expand Down
22 changes: 13 additions & 9 deletions proof/proof/src/TProof.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -660,16 +660,20 @@ TProof::~TProof()
if (TestBit(TProof::kIsClient)) {
// iterate over all packages
TList *epl = fPackMgr->GetListOfEnabled();
TIter nxp(epl);
while (TObjString *pck = (TObjString *)(nxp())) {
FileStat_t stat;
if (gSystem->GetPathInfo(pck->String(), stat) == 0) {
// check if symlink, if so unlink
// NOTE: GetPathInfo() returns 1 in case of symlink that does not point to
// existing file or to a directory, but if fIsLink is true the symlink exists
if (stat.fIsLink)
gSystem->Unlink(pck->String());
if (epl) {
TIter nxp(epl);
while (TObjString *pck = (TObjString *)(nxp())) {
FileStat_t stat;
if (gSystem->GetPathInfo(pck->String(), stat) == 0) {
// check if symlink, if so unlink
// NOTE: GetPathInfo() returns 1 in case of symlink that does not point to
// existing file or to a directory, but if fIsLink is true the symlink exists
if (stat.fIsLink)
gSystem->Unlink(pck->String());
}
}
epl->Delete();
delete epl;
}
}

Expand Down