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