Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
XrdROOT.cxx
Go to the documentation of this file.
1// @(#)root/proofd:$Id$
2// Author: Gerardo Ganis June 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12//////////////////////////////////////////////////////////////////////////
13// //
14// XrdROOT //
15// //
16// Authors: G. Ganis, CERN, 2007 //
17// //
18// Class describing a ROOT version //
19// //
20//////////////////////////////////////////////////////////////////////////
21#include "RConfigure.h"
22#include "ROOT/RVersion.hxx"
23#include "RGitCommit.h"
24
25#include "XrdProofdPlatform.h"
26
27#include "XrdROOT.h"
28#include "XrdProofdManager.h"
29#include "XrdProofdProtocol.h"
31#include "Xrd/XrdScheduler.hh"
32#include "XrdOuc/XrdOucStream.hh"
33#include "XrdSys/XrdSysPriv.hh"
34#include "XpdSysLogger.h"
35
36// Tracing
37#include "XrdProofdTrace.h"
38
39////////////////////////////////////////////////////////////////////////////////
40/// Constructor: validates 'dir', gets the version and defines the tag.
41
42XrdROOT::XrdROOT(const char *dir, const char *tag, const char *bindir,
43 const char *incdir, const char *libdir, const char *datadir)
44{
45 XPDLOC(SMGR, "XrdROOT")
46
47 fStatus = -1;
48 fSrvProtVers = -1;
50 fGitCommit = ROOT_GIT_COMMIT;
55
56 // 'dir' must make sense
57 if (!dir || strlen(dir) <= 0)
58 return;
59 if (tag && strlen(tag) > 0) {
60 fExport = tag;
61 fExport += " "; fExport += dir;
62 } else
63 fExport += dir;
64 // ... and exist
65 if (CheckDir(dir) != 0) return;
66 fDir = dir;
67
68 // Include dir
69 fIncDir = incdir;
70 if (!incdir || strlen(incdir) <= 0) {
71 fIncDir = fDir;
72 fIncDir += "/include";
73 }
74 if (CheckDir(fIncDir.c_str()) != 0) return;
75
76 // Parse version info
77 if (ParseROOTVersionInfo() == -1) {
78 TRACE(XERR, "unable to extract ROOT version information from path "<<fIncDir);
79 return;
80 }
81
82 // Default tag is the version
83 fTag = (!tag || strlen(tag) <= 0) ? fRelease : tag;
84
85 // Lib dir
86 fLibDir = libdir;
87 if (!libdir || strlen(libdir) <= 0) {
88 fLibDir = fDir;
89 fLibDir += "/lib";
90 }
91 if (CheckDir(fLibDir.c_str()) != 0) return;
92
93 // Bin dir
94 fBinDir = bindir;
95 if (!bindir || strlen(bindir) <= 0) {
96 fBinDir = fDir;
97 fBinDir += "/bin";
98 }
99 if (CheckDir(fBinDir.c_str()) != 0) return;
100
101 // Data dir
102 fDataDir = datadir;
103 if (!datadir || strlen(datadir) <= 0) {
104 fDataDir = fDir;
105 }
106 if (CheckDir(fDataDir.c_str()) != 0) return;
107
108 // The application to be run
110 fPrgmSrv += "/proofserv";
111
112 // Export string
113 fExport = fTag;
114 fExport += " "; fExport += fRelease;
115 fExport += " "; fExport += dir;
116
117 // First step OK
118 fStatus = 0;
119}
120
121////////////////////////////////////////////////////////////////////////////////
122/// Check if 'dir' exists
123/// Return 0 on succes, -1 on failure
124
125int XrdROOT::CheckDir(const char *dir)
126{
127 XPDLOC(SMGR, "CheckDir")
128
129 if (dir && strlen(dir) > 0) {
130 // The path should exist and be statable
131 struct stat st;
132 if (stat(dir, &st) == -1) {
133 TRACE(XERR, "unable to stat path "<<dir);
134 return -1;
135 }
136 // ... and be a directory
137 if (!S_ISDIR(st.st_mode)) {
138 TRACE(XERR, "path "<<dir<<" is not a directory");
139 return -1;
140 }
141 // Ok
142 return 0;
143 }
144 TRACE(XERR, "path is undefined");
145 return -1;
146}
147
148////////////////////////////////////////////////////////////////////////////////
149/// Set valid, save protocol and finalize the export string
150
151void XrdROOT::SetValid(kXR_int16 vers)
152{
153 fStatus = 1;
154
155 if (vers > 0) {
156 // Cleanup export, if needed
157 if (fSrvProtVers > 0) {
158 XrdOucString vs(" ");
159 vs += fSrvProtVers;
160 fExport.replace(vs,XrdOucString(""));
161 }
162 fSrvProtVers = vers;
163
164 // Finalize export string
165 fExport += " ";
167 }
168}
169
170////////////////////////////////////////////////////////////////////////////////
171/// Extract ROOT version information associated with 'dir'.
172
174{
175 XPDLOC(SMGR, "ParseROOTVersionInfo")
176
177 // Version code must be there
178 if (fVersionCode < 0) {
179 TRACE(XERR, "incomplete info found in "<<versfile<<": version code missing or bad: "<<fVersionCode);
180 return rc;
181 }
182
183 // Release tag must be there and in the right format
184 if (fRelease.length() <= 0 ||
186 TRACE(XERR, "incomplete info found in "<<versfile<<": release tag missing or bad: "<<fRelease);
187 return rc;
188 }
189
190 // Done
191 return 0;
192}
193
194////////////////////////////////////////////////////////////////////////////////
195/// Translate 'release' into a version code integer following the rules
196/// in $ROOTSYS/include/RVersion.h.
197/// 'release' must be in the format 'M.N/PP`<something_else>`', e.g. 5.20/04-cms
198
199int XrdROOT::GetVersionCode(const char *release)
200{
201 int maj, min, patch;
202 if (XrdROOT::ParseReleaseString(release, maj, min, patch) < 0) return -1;
203 return XrdROOT::GetVersionCode(maj, min, patch);
204}
205
206////////////////////////////////////////////////////////////////////////////////
207/// Translate 'release' into a version code integer following the rules
208/// in $ROOTSYS/include/RVersion.h
209
210int XrdROOT::GetVersionCode(int maj, int min, int patch)
211{
212 return ((maj << 16) + (min << 8) + patch);
213}
214
215////////////////////////////////////////////////////////////////////////////////
216/// Extract from 'release' its major, minor and patch numerical components;
217/// 'release' must be in the format 'M.N/PP`<something_else>`', e.g. 5.20/04-cms;
218/// the part `<something_else>` is ignored.
219
220int XrdROOT::ParseReleaseString(const char *release,
221 int &maj, int &min, int &patch)
222{
223 if (!release || strlen(release) <= 0) return -1;
224
225 XrdOucString rel(release, 7), tkn;
226 int from = 0;
227 if ((from = rel.tokenize(tkn, from, '.')) == -1) return -1;
228 maj = atoi(tkn.c_str());
229 if ((from = rel.tokenize(tkn, from, '/')) == -1) return -1;
230 min = atoi(tkn.c_str());
231 if ((from = rel.tokenize(tkn, from, ' ')) == -1) return -1;
232 patch = atoi(tkn.c_str());
233
234 return 0;
235}
236
237//
238// Manager
239
240////////////////////////////////////////////////////////////////////////////////
241/// Constructor
242
244 XrdProtocol_Config *pi, XrdSysError *e)
245 : XrdProofdConfig(pi->ConfigFN, e)
246{
247 fMgr = mgr;
248 fLogger = pi->eDest->logger();
249 fROOT.clear();
250
251 // Configuration directives
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Set the log dir
257
258void XrdROOTMgr::SetLogDir(const char *dir)
259{
260 XPDLOC(SMGR, "ROOTMgr::SetLogDir")
261
262 if (fMgr && dir && strlen(dir)) {
263 // MAke sure that the directory to store logs from validation exists
264 XPDFORM(fLogDir, "%s/rootsysvalidation", dir);
265 XrdProofUI ui;
267 if (XrdProofdAux::AssertDir(fLogDir.c_str(), ui, fMgr->ChangeOwn()) != 0) {
268 XPDERR("unable to assert the rootsys log validation path: "<<fLogDir);
269 fLogDir = "";
270 } else {
271 TRACE(ALL,"rootsys log validation path: "<<fLogDir);
272 }
273 }
274}
275
276////////////////////////////////////////////////////////////////////////////////
277/// Run configuration and parse the entered config directives.
278/// Return 0 on success, -1 on error
279
281{
282 XPDLOC(SMGR, "ROOTMgr::Config")
283
284 // Run first the configurator
285 if (XrdProofdConfig::Config(rcf) != 0) {
286 TRACE(XERR, "problems parsing file ");
287 return -1;
288 }
289
290 XrdOucString msg;
291 msg = (rcf) ? "re-configuring" : "configuring";
292 TRACE(ALL, msg);
293
294 // ROOT dirs
295 if (rcf) {
296 // Remove parked ROOT sys entries
297 std::list<XrdROOT *>::iterator tri;
298 if (fROOT.size() > 0) {
299 for (tri = fROOT.begin(); tri != fROOT.end();) {
300 if ((*tri)->IsParked()) {
301 delete (*tri);
302 tri = fROOT.erase(tri);
303 } else {
304 ++tri;
305 }
306 }
307 }
308 } else {
309 // Check the ROOT dirs
310 if (fROOT.size() <= 0) {
311 XrdOucString dir, bd, ld, id, dd;
312#ifdef R__HAVE_CONFIG
313 if (getenv("ROOTIGNOREPREFIX"))
314#endif
315 dir = getenv("ROOTSYS");
316#ifdef R__HAVE_CONFIG
317 else {
318 dir = ROOTPREFIX;
319 bd = ROOTBINDIR;
320 ld = ROOTLIBDIR;
321 id = ROOTINCDIR;
322 dd = ROOTDATADIR;
323 }
324#endif
325 // None defined: use ROOTSYS as default, if any; otherwise we fail
326 if (dir.length() > 0) {
327 XrdROOT *rootc = new XrdROOT(dir.c_str(), "",
328 bd.c_str(), id.c_str(), ld.c_str(), dd.c_str());
329 if (Validate(rootc, fMgr->Sched()) == 0) {
330 XPDFORM(msg, "ROOT dist: '%s' validated", rootc->Export());
331 fROOT.push_back(rootc);
332 TRACE(ALL, msg);
333 XrdOucString mnp;
334 XPDFORM(mnp, "ROOT version details: git: '%s', code: %d, {mnp} = {%d,%d,%d}",
335 rootc->GitCommit(), rootc->VersionCode(), rootc->VrsMajor(),
336 rootc->VrsMinor(), rootc->VrsPatch());
337 TRACE(ALL, mnp);
338 } else {
339 XPDFORM(msg, "ROOT dist: '%s' could not be validated", rootc->Export());
340 TRACE(XERR, msg);
341 }
342 }
343 if (fROOT.size() <= 0) {
344 TRACE(XERR, "no ROOT dir defined; ROOTSYS location missing - unloading");
345 return -1;
346 }
347 }
348 }
349
350 // Done
351 return 0;
352}
353
354////////////////////////////////////////////////////////////////////////////////
355/// Register directives for configuration
356
358{
359 Register("rootsys", new XrdProofdDirective("rootsys", this, &DoDirectiveClass));
360}
361
362////////////////////////////////////////////////////////////////////////////////
363/// Update the priorities of the active sessions.
364
366 char *val, XrdOucStream *cfg, bool rcf)
367{
368 XPDLOC(SMGR, "ROOTMgr::DoDirective")
369
370 if (!d)
371 // undefined inputs
372 return -1;
373
374 if (d->fName == "rootsys") {
375 return DoDirectiveRootSys(val, cfg, rcf);
376 }
377 TRACE(XERR, "unknown directive: "<<d->fName);
378 return -1;
379}
380
381////////////////////////////////////////////////////////////////////////////////
382/// Process 'rootsys' directive
383
384int XrdROOTMgr::DoDirectiveRootSys(char *val, XrdOucStream *cfg, bool)
385{
386 XPDLOC(SMGR, "ROOTMgr::DoDirectiveRootSys")
387
388 if (!val || !cfg)
389 // undefined inputs
390 return -1;
391
392 // Two tokens may be meaningful
393 XrdOucString dir = val;
394 val = cfg->GetWord();
395 XrdOucString tag = val;
396 bool ok = 1;
397 if (tag == "if") {
398 tag = "";
399 // Conditional
400 cfg->RetToken();
401 ok = (XrdProofdAux::CheckIf(cfg, fMgr->Host()) > 0) ? 1 : 0;
402 }
403 if (ok) {
404 // Check for additional info in the form: bindir incdir libdir datadir
405 XrdOucString a[4];
406 int i = 0;
407 if (tag.length() > 0) {
408 while ((val = cfg->GetWord())) { a[i++] = val; }
409 }
410 XrdROOT *rootc = new XrdROOT(dir.c_str(), tag.c_str(), a[0].c_str(),
411 a[1].c_str(), a[2].c_str(), a[3].c_str());
412 // Check if already validated
413 std::list<XrdROOT *>::iterator ori;
414 for (ori = fROOT.begin(); ori != fROOT.end(); ++ori) {
415 if ((*ori)->Match(rootc->Dir(), rootc->Tag())) {
416 if ((*ori)->IsParked()) {
417 (*ori)->SetValid();
418 SafeDel(rootc);
419 break;
420 }
421 }
422 }
423 // If not, try validation
424 if (rootc) {
425 if (Validate(rootc, fMgr->Sched()) == 0) {
426 TRACE(REQ, "validation OK for: "<<rootc->Export());
427 XrdOucString mnp;
428 XPDFORM(mnp, "version details: git: '%s', code: %d, {mnp} = {%d,%d,%d}",
429 rootc->GitCommit(), rootc->VersionCode(), rootc->VrsMajor(),
430 rootc->VrsMinor(), rootc->VrsPatch());
431 TRACE(REQ, mnp);
432 // Add to the list
433 fROOT.push_back(rootc);
434 } else {
435 TRACE(XERR, "could not validate "<<rootc->Export());
436 SafeDel(rootc);
437 }
438 }
439 }
440 return 0;
441}
442
443////////////////////////////////////////////////////////////////////////////////
444/// Start a trial server application to test forking and get the version
445/// of the protocol run by the PROOF server.
446/// Return 0 if everything goes well, -1 in case of any error.
447
448int XrdROOTMgr::Validate(XrdROOT *r, XrdScheduler *sched)
449{
450 XPDLOC(SMGR, "ROOTMgr::Validate")
451
452 TRACE(REQ, "forking test and protocol retrieval");
453
454 if (r->IsInvalid()) {
455 // Cannot be validated
456 TRACE(XERR, "invalid instance - cannot be validated");
457 return -1;
458 }
459
460 // Make sure the application path has been defined
461 if (!r->PrgmSrv() || strlen(r->PrgmSrv()) <= 0) {
462 TRACE(XERR, "path to PROOF server application undefined - exit");
463 return -1;
464 }
465
466 // Make sure the scheduler is defined
467 if (!sched) {
468 TRACE(XERR, "scheduler undefined - exit");
469 return -1;
470 }
471
472 // Pipe to communicate the protocol number
473 int fp[2];
474 if (pipe(fp) != 0) {
475 TRACE(XERR, "PROOT protocol number communication");
476 return -1;
477 }
478
479 // Debug flag
480 bool debug = 0;
481 if (TRACING(DBG)) debug = 1;
482
483 // Log the attemp into this file
484 XrdOucString logfile, rootrc;
485 if (fLogDir.length() > 0) {
486 XrdOucString tag(r->Tag());
487 tag.replace("/","-");
488 XPDFORM(logfile, "%s/root.%s.log", fLogDir.c_str(), tag.c_str());
489 if (debug) {
490 XPDFORM(rootrc, "%s/root.%s.rootrc", fLogDir.c_str(), tag.c_str());
491 }
492 }
493
494 // Fork a test agent process to handle this session
495 TRACE(FORK,"XrdROOTMgr::Validate: forking external proofsrv");
496 int pid = -1;
497 if (!(pid = sched->Fork("proofsrv"))) {
498
499 if (logfile.length() > 0 && fLogger) {
500 // Log to the session log file from now on
501 fLogger->Bind(logfile.c_str());
502 // Transfer the info to proofserv
503 size_t len = strlen("ROOTPROOFLOGFILE=") + logfile.length() + 2;
504 char *ev = new char[len];
505 snprintf(ev, len, "ROOTPROOFLOGFILE=%s", logfile.c_str());
506 putenv(ev);
507 if (debug && rootrc.length() > 0) {
508 // Create .rootrc
509 FILE *frc = fopen(rootrc.c_str(),"w");
510 if (frc) {
511 fprintf(frc, "Proof.DebugLevel: 1\n");
512 fclose(frc);
513 }
514 // Transfer the info to proofserv
515 len = strlen("ROOTRCFILE=") + rootrc.length() + 2;
516 ev = new char[len];
517 snprintf(ev, len, "ROOTRCFILE=%s", rootrc.c_str());
518 putenv(ev);
519 }
520 }
521
522 char *argvv[6] = {0};
523
524 // start server
525 argvv[0] = (char *)r->PrgmSrv();
526 argvv[1] = (char *)"proofserv";
527 argvv[2] = (char *)"xpd";
528 argvv[3] = (char *)"test";
529 if (debug) {
530 argvv[4] = (char *)"1";
531 argvv[5] = 0;
532 } else {
533 argvv[4] = 0;
534 argvv[5] = 0;
535 }
536
537 // Set basic environment for proofserv
539 TRACE(XERR, " SetProofServEnv did not return OK - EXIT");
540 exit(1);
541 }
542
543 // Set Open socket
544 char *ev = new char[25];
545 snprintf(ev, 25, "ROOTOPENSOCK=%d", fp[1]);
546 putenv(ev);
547
548 // Prepare for execution: we need to acquire the identity of
549 // a normal user
550 if (!getuid()) {
551 XrdProofUI ui;
552 if (XrdProofdAux::GetUserInfo(geteuid(), ui) != 0) {
553 TRACE(XERR, "could not get info for user-id: "<<geteuid());
554 exit(1);
555 }
556
557 // acquire permanently target user privileges
558 if (XrdSysPriv::ChangePerm((uid_t)ui.fUid, (gid_t)ui.fGid) != 0) {
559 TRACE(XERR, "can't acquire "<<ui.fUser <<" identity");
560 exit(1);
561 }
562
563 }
564
565 // Run the program
566 execv(r->PrgmSrv(), argvv);
567
568 // We should not be here!!!
569 TRACE(XERR, "returned from execv: bad, bad sign !!!");
570 exit(1);
571 }
572
573 // parent process
574 if (pid < 0) {
575 TRACE(XERR, "forking failed - exit");
576 close(fp[0]);
577 close(fp[1]);
578 return -1;
579 }
580
581 // now we wait for the callback to be (successfully) established
582 TRACE(FORK, "test server launched: wait for protocol ");
583
584 // Read protocol
585 int proto = -1;
586 struct pollfd fds_r;
587 fds_r.fd = fp[0];
588 fds_r.events = POLLIN;
589 int pollRet = 0;
590 // We wait for 60 secs max (30 x 2000 millisecs): this is enough to
591 // cover possible delays due to heavy load
592 int ntry = 30;
593 while (pollRet == 0 && ntry--) {
594 while ((pollRet = poll(&fds_r, 1, 2000)) < 0 &&
595 (errno == EINTR)) { }
596 if (pollRet == 0)
597 TRACE(DBG, "receiving PROOF server protocol number: waiting 2 s ...");
598 }
599 if (pollRet > 0) {
600 if (read(fp[0], &proto, sizeof(proto)) != sizeof(proto)) {
601 TRACE(XERR, "problems receiving PROOF server protocol number");
602 return -1;
603 }
604 } else {
605 if (pollRet == 0) {
606 TRACE(XERR, "timed-out receiving PROOF server protocol number");
607 } else {
608 TRACE(XERR, "failed to receive PROOF server protocol number");
609 }
610 return -1;
611 }
612
613 // Set valid, record protocol and update export string
614 r->SetValid((kXR_int16) ntohl(proto));
615
616 // Cleanup files
617 if (logfile.length() > 0 && !debug) {
618 if (unlink(logfile.c_str()) != 0) {
619 TRACE(XERR, "problems unlinking "<<logfile<<"; errno: "<<errno);
620 }
621 }
622 if (debug && rootrc.length() > 0 && unlink(rootrc.c_str()) != 0) {
623 TRACE(XERR, "problems unlinking "<<rootrc<<"; errno: "<<errno);
624 }
625
626 // Cleanup
627 close(fp[0]);
628 close(fp[1]);
629
630 // We are done
631 return 0;
632}
633
634////////////////////////////////////////////////////////////////////////////////
635/// Return a string describing the available versions, with the default
636/// version 'def' markde with a '*'
637
639{
640 XrdOucString out;
641
642 // Generic info about all known sessions
643 std::list<XrdROOT *>::iterator ip;
644 for (ip = fROOT.begin(); ip != fROOT.end(); ++ip) {
645 // Flag the default one
646 if (def == *ip)
647 out += " * ";
648 else
649 out += " ";
650 out += (*ip)->Export();
651 out += "\n";
652 }
653
654 // Over
655 return out;
656}
657
658////////////////////////////////////////////////////////////////////////////////
659/// Return pointer to the ROOT version corresponding to 'tag'
660/// or 0 if not found.
661
663{
664 XrdROOT *r = 0;
665
666 std::list<XrdROOT *>::iterator ip;
667 for (ip = fROOT.begin(); ip != fROOT.end(); ++ip) {
668 if ((*ip)->MatchTag(tag)) {
669 r = (*ip);
670 break;
671 }
672 }
673
674 // Over
675 return r;
676}
#define d(i)
Definition RSha256.hxx:102
#define a(i)
Definition RSha256.hxx:99
#define e(i)
Definition RSha256.hxx:103
#define ROOT_VERSION_PATCH
Definition RVersion.hxx:7
#define ROOT_RELEASE
Definition RVersion.hxx:28
#define ROOT_VERSION_MAJOR
Definition RVersion.hxx:5
#define ROOT_VERSION_CODE
Definition RVersion.hxx:23
#define ROOT_VERSION_MINOR
Definition RVersion.hxx:6
#define TRACE(Flag, Args)
Definition TGHtml.h:121
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
#define XrdSysError
Definition XpdSysError.h:8
#define XPDFORM
#define SafeDel(x)
int DoDirectiveClass(XrdProofdDirective *, char *val, XrdOucStream *cfg, bool rcf)
Generic class directive processor.
#define XPDLOC(d, x)
#define TRACING(x)
#define XPDERR(x)
const char * proto
Definition civetweb.c:17536
#define snprintf
Definition civetweb.c:1540
XrdOucString fUser
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)
bool ChangeOwn() const
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...
Definition XrdROOT.cxx:448
XrdROOT * GetVersion(const char *tag)
Return pointer to the ROOT version corresponding to 'tag' or 0 if not found.
Definition XrdROOT.cxx:662
XrdSysLogger * fLogger
Definition XrdROOT.h:100
int DoDirective(XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
Update the priorities of the active sessions.
Definition XrdROOT.cxx:365
void RegisterDirectives()
Register directives for configuration.
Definition XrdROOT.cxx:357
XrdOucString ExportVersions(XrdROOT *def)
Return a string describing the available versions, with the default version 'def' markde with a '*'.
Definition XrdROOT.cxx:638
XrdOucString fLogDir
Definition XrdROOT.h:101
std::list< XrdROOT * > fROOT
Definition XrdROOT.h:103
XrdROOTMgr(XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e)
Constructor.
Definition XrdROOT.cxx:243
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
Definition XrdROOT.cxx:280
void SetLogDir(const char *d)
Set the log dir.
Definition XrdROOT.cxx:258
int DoDirectiveRootSys(char *, XrdOucStream *, bool)
Process 'rootsys' directive.
Definition XrdROOT.cxx:384
XrdProofdManager * fMgr
Definition XrdROOT.h:99
int VrsPatch() const
Definition XrdROOT.h:87
int fVrsMinor
Definition XrdROOT.h:54
XrdOucString fGitCommit
Definition XrdROOT.h:50
static int GetVersionCode(const char *release)
Translate 'release' into a version code integer following the rules in $ROOTSYS/include/RVersion....
Definition XrdROOT.cxx:199
const char * Export() const
Definition XrdROOT.h:70
int fStatus
Definition XrdROOT.h:38
const char * Tag() const
Definition XrdROOT.h:83
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...
Definition XrdROOT.cxx:220
int fVrsMajor
Definition XrdROOT.h:53
XrdROOT(const char *dir, const char *tag, const char *bindir=0, const char *incdir=0, const char *libdir=0, const char *datadir=0)
Constructor: validates 'dir', gets the version and defines the tag.
Definition XrdROOT.cxx:42
int VrsMajor() const
Definition XrdROOT.h:85
XrdOucString fRelease
Definition XrdROOT.h:49
int VersionCode() const
Definition XrdROOT.h:84
int CheckDir(const char *dir)
Check if 'dir' exists Return 0 on succes, -1 on failure.
Definition XrdROOT.cxx:125
XrdOucString fIncDir
Definition XrdROOT.h:42
kXR_int16 fSrvProtVers
Definition XrdROOT.h:47
int fVersionCode
Definition XrdROOT.h:51
XrdOucString fPrgmSrv
Definition XrdROOT.h:46
XrdOucString fExport
Definition XrdROOT.h:45
int fVrsPatch
Definition XrdROOT.h:55
int ParseROOTVersionInfo()
Extract ROOT version information associated with 'dir'.
Definition XrdROOT.cxx:173
XrdOucString fTag
Definition XrdROOT.h:44
const char * GitCommit() const
Definition XrdROOT.h:71
void SetValid(kXR_int16 vers=-1)
Set valid, save protocol and finalize the export string.
Definition XrdROOT.cxx:151
const char * Dir() const
Definition XrdROOT.h:65
XrdOucString fBinDir
Definition XrdROOT.h:40
XrdOucString fDir
Definition XrdROOT.h:39
XrdOucString fDataDir
Definition XrdROOT.h:41
XrdOucString fLibDir
Definition XrdROOT.h:43
int VrsMinor() const
Definition XrdROOT.h:86
static int ChangePerm(uid_t uid, gid_t gid)