21#include "RConfigure.h"
30#include "Xrd/XrdScheduler.hh"
31#include "XrdOuc/XrdOucStream.hh"
90 TRACE(
XERR,
"unable to extract ROOT version information from path "<<
fIncDir);
121 if (stat(
dir, &
st) == -1) {
147 XrdOucString
vs(
" ");
187 TRACE(
XERR,
"incomplete info found: not a ROOT release and no " <<
fEtcDir +
"/gitinfo.txt");
219 return ((
maj << 16) + (min << 8) +
patch);
230 if (!release ||
strlen(release) <= 0)
return -1;
232 XrdOucString
rel(release, 7),
tkn;
237 min = atoi(
tkn.c_str());
275 XPDERR(
"unable to assert the rootsys log validation path: "<<
fLogDir);
298 msg = (
rcf) ?
"re-configuring" :
"configuring";
304 std::list<XrdROOT *>::iterator
tri;
305 if (
fROOT.size() > 0) {
307 if ((*tri)->IsParked()) {
317 if (
fROOT.size() <= 0) {
320 if (
getenv(
"ROOTIGNOREPREFIX"))
334 if (
dir.length() > 0) {
336 bd.c_str(),
id.c_str(), ld.c_str(), dd.c_str(),
ed.c_str());
342 XPDFORM(
mnp,
"ROOT version details: git: '%s', code: %d, {mnp} = {%d,%d,%d}",
347 XPDFORM(
msg,
"ROOT dist: '%s' could not be validated",
rootc->Export());
351 if (
fROOT.size() <= 0) {
352 TRACE(
XERR,
"no ROOT dir defined; ROOTSYS location missing - unloading");
382 if (
d->fName ==
"rootsys") {
401 XrdOucString
dir = val;
402 val = cfg->GetWord();
403 XrdOucString tag = val;
415 if (tag.length() > 0) {
416 while ((val = cfg->GetWord())) {
a[i++] = val; }
419 a[1].c_str(),
a[2].c_str(),
a[3].c_str());
421 std::list<XrdROOT *>::iterator
ori;
423 if ((*ori)->Match(
rootc->Dir(),
rootc->Tag())) {
424 if ((*ori)->IsParked()) {
436 XPDFORM(
mnp,
"version details: git: '%s', code: %d, {mnp} = {%d,%d,%d}",
460 TRACE(
REQ,
"forking test and protocol retrieval");
462 if (
r->IsInvalid()) {
464 TRACE(
XERR,
"invalid instance - cannot be validated");
469 if (!
r->PrgmSrv() ||
strlen(
r->PrgmSrv()) <= 0) {
470 TRACE(
XERR,
"path to PROOF server application undefined - exit");
476 TRACE(
XERR,
"scheduler undefined - exit");
483 TRACE(
XERR,
"PROOT protocol number communication");
492 XrdOucString logfile,
rootrc;
494 XrdOucString tag(
r->Tag());
495 tag.replace(
"/",
"-");
503 TRACE(
FORK,
"XrdROOTMgr::Validate: forking external proofsrv");
505 if (!(pid =
sched->Fork(
"proofsrv"))) {
507 if (logfile.length() > 0 &&
fLogger) {
509 fLogger->Bind(logfile.c_str());
511 size_t len =
strlen(
"ROOTPROOFLOGFILE=") + logfile.length() + 2;
512 char *
ev =
new char[
len];
530 char *
argvv[6] = {0};
533 argvv[0] = (
char *)
r->PrgmSrv();
534 argvv[1] = (
char *)
"proofserv";
535 argvv[2] = (
char *)
"xpd";
536 argvv[3] = (
char *)
"test";
538 argvv[4] = (
char *)
"1";
547 TRACE(
XERR,
" SetProofServEnv did not return OK - EXIT");
552 char *
ev =
new char[25];
567 TRACE(
XERR,
"can't acquire "<<
ui.fUser <<
" identity");
577 TRACE(
XERR,
"returned from execv: bad, bad sign !!!");
590 TRACE(
FORK,
"test server launched: wait for protocol ");
605 TRACE(
DBG,
"receiving PROOF server protocol number: waiting 2 s ...");
609 TRACE(
XERR,
"problems receiving PROOF server protocol number");
614 TRACE(
XERR,
"timed-out receiving PROOF server protocol number");
616 TRACE(
XERR,
"failed to receive PROOF server protocol number");
625 if (logfile.length() > 0 && !
debug) {
626 if (
unlink(logfile.c_str()) != 0) {
651 std::list<XrdROOT *>::iterator
ip;
658 out += (*ip)->Export();
674 std::list<XrdROOT *>::iterator
ip;
676 if ((*ip)->MatchTag(tag)) {
#define ROOT_VERSION_PATCH
#define ROOT_VERSION_MAJOR
#define ROOT_VERSION_CODE
#define ROOT_VERSION_MINOR
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define TRACE(Flag, Args)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t target
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
int DoDirectiveClass(XrdProofdDirective *, char *val, XrdOucStream *cfg, bool rcf)
Generic class directive processor.
static int GetUserInfo(const char *usr, XrdProofUI &ui)
Get information about user 'usr' in a thread safe way.
static int AssertDir(const char *path, XrdProofUI ui, bool changeown)
Make sure that 'path' exists and is owned by the entity described by 'ui'.
static int CheckIf(XrdOucStream *s, const char *h)
Check existence and match condition of an 'if' directive If none (valid) is found,...
virtual int Config(bool rcf=0)
void Register(const char *dname, XrdProofdDirective *d)
XrdScheduler * Sched() const
const char * Host() const
const char * EffectiveUser() const
int SetProofServEnv(XrdProofdProtocol *p, void *in)
Set environment for proofserv.
int Validate(XrdROOT *r, XrdScheduler *sched)
Start a trial server application to test forking and get the version of the protocol run by the PROOF...
XrdROOT * GetVersion(const char *tag)
Return pointer to the ROOT version corresponding to 'tag' or 0 if not found.
int DoDirective(XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
Update the priorities of the active sessions.
void RegisterDirectives()
Register directives for configuration.
XrdOucString ExportVersions(XrdROOT *def)
Return a string describing the available versions, with the default version 'def' markde with a '*'.
std::list< XrdROOT * > fROOT
XrdROOTMgr(XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e)
Constructor.
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
void SetLogDir(const char *d)
Set the log dir.
int DoDirectiveRootSys(char *, XrdOucStream *, bool)
Process 'rootsys' directive.
static int GetVersionCode(const char *release)
Translate 'release' into a version code integer following the rules in $ROOTSYS/include/RVersion....
static int ParseReleaseString(const char *release, int &maj, int &min, int &patch)
Extract from 'release' its major, minor and patch numerical components; 'release' must be in the form...
int CheckDir(const char *dir)
Check if 'dir' exists Return 0 on succes, -1 on failure.
XrdROOT(const char *dir, const char *tag, const char *bindir=0, const char *incdir=0, const char *libdir=0, const char *datadir=0, const char *etcdir=0)
Constructor: validates 'dir', gets the version and defines the tag.
int ParseROOTVersionInfo()
Extract ROOT version information associated with 'dir'.
void SetValid(kXR_int16 vers=-1)
Set valid, save protocol and finalize the export string.
static int ChangePerm(uid_t uid, gid_t gid)