XRootD
Loading...
Searching...
No Matches
XrdCmsConfig Class Reference

#include <XrdCmsConfig.hh>

+ Inheritance diagram for XrdCmsConfig:
+ Collaboration diagram for XrdCmsConfig:

Public Member Functions

 XrdCmsConfig ()
 
 ~XrdCmsConfig ()
 
int asManager ()
 
int asMetaMan ()
 
int asPeer ()
 
int asProxy ()
 
int asServer ()
 
int asSolo ()
 
int Configure0 (XrdProtocol_Config *pi)
 
int Configure1 (int argc, char **argv, char *cfn)
 
int Configure2 ()
 
int ConfigXeq (char *var, XrdOucStream &CFile, XrdSysError *eDest)
 
void DoIt ()
 
int GenLocalPath (const char *oldp, char *newp)
 
- Public Member Functions inherited from XrdJob
 XrdJob (const char *desc="")
 
virtual ~XrdJob ()
 
virtual void DoIt ()=0
 

Public Attributes

XrdNetSocketAdminSock
 
int adsMon
 
int adsPort
 
char * adsProt
 
XrdNetSocketAnoteSock
 
int AskPerf
 
int AskPing
 
char * cidTag
 
char * ConfigFN
 
int DELDelay
 
unsigned long long DirFlags
 
int DiskAsk
 
int DiskHWM
 
short DiskHWMP
 
int DiskLinger
 
int DiskMin
 
short DiskMinP
 
bool DiskOK
 
bool DiskSS
 
int DiskWT
 
char DoHnTry
 
char DoMWChk
 
int doWait
 
int DRPDelay
 
char * envCGI
 
bool forceRO
 
const char * ifList
 
XrdOucName2Namelcl_N2N
 
char * LocalRoot
 
int LogPerf
 
int LUPDelay
 
int LUPHold
 
XrdOucTListManList
 
int MaxDelay
 
int MaxLoad
 
int MaxRetries
 
int mrRdrHLen
 
char * mrRdrHost
 
int mrRdrPort
 
int MsgTTL
 
int msRdrHLen
 
char * msRdrHost
 
int msRdrPort
 
char MultiSrc
 
const char * myDomain
 
const char * myInsName
 
const char * myInstance
 
const char * myName
 
char * myPaths
 
const char * myProg
 
char * myRole
 
char myRoleID
 
char myRType [4]
 
const char * mySID
 
const char * mySite
 
XrdVersionInfo * myVInfo
 
const char * myVNID
 
char * N2N_Lib
 
char * N2N_Parms
 
XrdOucTListNanList
 
char nbSQ
 
XrdInetNetTCP
 
XrdOssossFS
 
char * ossLib
 
char * ossParms
 
int P_cpu
 
int P_dsk
 
int P_fuzz
 
int P_gsdf
 
int P_gshr
 
int P_io
 
int P_load
 
int P_mem
 
int P_pag
 
XrdCmsPList_Anchor PathList
 
XrdOucPListAnchor PexpList
 
int PingTick
 
XrdNetSecurityPolice
 
int PortSUP
 
int PortTCP
 
char * prfLib
 
char * prfParms
 
XrdOucProgProgCH
 
XrdOucProgProgMD
 
XrdOucProgProgMP
 
XrdOucProgProgMV
 
XrdOucProgProgRD
 
XrdOucProgProgRM
 
XrdOucProgProgTR
 
int PSDelay
 
int QryDelay
 
int QryMinum
 
XrdNetSocketRedirSock
 
int RefReset
 
int RefTurn
 
char * RemotRoot
 
short RepStats
 
char rsvd [3]
 
int RWDelay
 
XrdOucTListSanList
 
char sched_AffPC
 
char sched_Force
 
char sched_Level
 
char sched_LoadR
 
char sched_Pack
 
char sched_RR
 
int SRVDelay
 
int SUPCount
 
int SUPDelay
 
int SUPLevel
 
int SUSDelay
 
char TimeZone
 
char * VNID_Lib
 
char * VNID_Parms
 
XrdOucName2Namexeq_N2N
 
- Public Attributes inherited from XrdJob
const char * Comment
 
XrdJobNextJob
 

Static Public Attributes

static const int RepStat_All = 0xffff
 
static const int RepStat_frq = 0x0001
 
static const int RepStat_shr = 0x0002
 

Detailed Description

Definition at line 56 of file XrdCmsConfig.hh.

Constructor & Destructor Documentation

◆ XrdCmsConfig()

XrdCmsConfig::XrdCmsConfig ( )
inline

Definition at line 203 of file XrdCmsConfig.hh.

203: XrdJob("cmsd startup") {ConfigDefaults();}

◆ ~XrdCmsConfig()

XrdCmsConfig::~XrdCmsConfig ( )
inline

Definition at line 204 of file XrdCmsConfig.hh.

204{}

Member Function Documentation

◆ asManager()

int XrdCmsConfig::asManager ( )
inline

Definition at line 66 of file XrdCmsConfig.hh.

66{return isManager;}

Referenced by XrdCmsCluster::Add(), XrdCmsManager::Add(), XrdCmsNode::do_Disc(), XrdCmsNode::do_Gone(), XrdCmsNode::do_Have(), XrdCmsNode::do_Load(), XrdCmsCluster::Remove(), and XrdCmsProtocol::Stats().

+ Here is the caller graph for this function:

◆ asMetaMan()

int XrdCmsConfig::asMetaMan ( )
inline

Definition at line 67 of file XrdCmsConfig.hh.

67{return isManager && isMeta;}

Referenced by XrdCmsCluster::Statt().

+ Here is the caller graph for this function:

◆ asPeer()

int XrdCmsConfig::asPeer ( )
inline

Definition at line 68 of file XrdCmsConfig.hh.

68{return isPeer;}

◆ asProxy()

int XrdCmsConfig::asProxy ( )
inline

Definition at line 69 of file XrdCmsConfig.hh.

69{return isProxy;}

Referenced by XrdCmsNode::do_State().

+ Here is the caller graph for this function:

◆ asServer()

int XrdCmsConfig::asServer ( )
inline

Definition at line 70 of file XrdCmsConfig.hh.

70{return isServer;}

Referenced by XrdCmsNode::do_StateFWD().

+ Here is the caller graph for this function:

◆ asSolo()

int XrdCmsConfig::asSolo ( )
inline

Definition at line 71 of file XrdCmsConfig.hh.

71{return isSolo;}

Referenced by XrdCmsMeter::Init(), and XrdCmsMeter::RunFS().

+ Here is the caller graph for this function:

◆ Configure0()

int XrdCmsConfig::Configure0 ( XrdProtocol_Config pi)

Definition at line 204 of file XrdCmsConfig.cc.

205{
206
207// Initialize the error message handler and get starting values
208//
209 Say.logger(pi->eDest->logger(0));
210 Trace.SetLogger(pi->eDest->logger(0));
211 myName = strdup(pi->myName);
212 PortTCP = (pi->Port < 0 ? 0 : pi->Port);
213 myInsName = strdup(pi->myInst);
214 myProg = strdup(pi->myProg);
215 Sched = pi->Sched;
216 if (pi->AdmPath) AdminPath = strdup(pi->AdmPath);
217 else AdminPath = XrdOucUtils::genPath("/tmp/",
219 AdminMode = pi->AdmMode;
220 if (pi->DebugON) Trace.What = TRACE_ALL;
221 xrdEnv = pi->theEnv;
222
223// Create an xrootd compatabile environment
224//
225 theEnv.PutPtr("XrdScheduler*", Sched);
226 if (pi->theEnv) theEnv.PutPtr("xrdEnv*", pi->theEnv);
227
228// All done
229//
230 return 0;
231}
#define TRACE_ALL
Definition XrdTrace.hh:35
const char * myInsName
const char * myName
const char * myProg
void PutPtr(const char *varname, void *value)
Definition XrdOucEnv.cc:298
static char * genPath(const char *path, const char *inst, const char *psfx=0)
static const char * InstName(int TranOpt=0)
const char * myName
XrdScheduler * Sched
const char * AdmPath
XrdSysError * eDest
XrdOucEnv * theEnv
const char * myProg
const char * myInst
XrdSysLogger * logger(XrdSysLogger *lp=0)
void SetLogger(XrdSysLogger *logp)
XrdScheduler * Sched
XrdSysError Say
XrdSysTrace Trace("cms")
XrdOucEnv theEnv

References XrdProtocol_Config::AdmMode, XrdProtocol_Config::AdmPath, XrdProtocol_Config::DebugON, XrdProtocol_Config::eDest, XrdOucUtils::genPath(), XrdOucUtils::InstName(), XrdSysError::logger(), myInsName, XrdProtocol_Config::myInst, XrdProtocol_Config::myName, myName, XrdProtocol_Config::myProg, myProg, XrdProtocol_Config::Port, PortTCP, XrdOucEnv::PutPtr(), XrdCms::Say, XrdProtocol_Config::Sched, XrdCms::Sched, XrdSysTrace::SetLogger(), XrdProtocol_Config::theEnv, XrdCms::theEnv, XrdCms::Trace, TRACE_ALL, and XrdSysTrace::What.

Referenced by XrdgetProtocolPort().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Configure1()

int XrdCmsConfig::Configure1 ( int  argc,
char **  argv,
char *  cfn 
)

Definition at line 237 of file XrdCmsConfig.cc.

238{
239/*
240 Function: Establish phase 1 configuration at start up time.
241
242 Input: argc - argument count
243 argv - argument vector
244 cfn - optional configuration file name
245
246 Output: 0 upon success or !0 otherwise.
247*/
248 int NoGo = 0, immed = 0;
249 char c, buff[512];
250 extern int opterr, optopt;
251
252// Process the options
253//
254 opterr = 0; optind = 1;
255 if (argc > 1 && '-' == *argv[1])
256 while ((c=getopt(argc,argv,"iw")) && ((unsigned char)c != 0xff))
257 { switch(c)
258 {
259 case 'i': immed = 1;
260 break;
261 case 'w': immed = -1; // Backward compatibility only
262 break;
263 default: buff[0] = '-'; buff[1] = optopt; buff[2] = '\0';
264 Say.Say("Config warning: unrecognized option, ",buff,", ignored.");
265 }
266 }
267
268// Accept a single parameter defining the overiding major role
269//
270 if (optind < argc)
271 { if (!strcmp(argv[optind], "manager")) isManager = 1;
272 else if (!strcmp(argv[optind], "server" )) isServer = 1;
273 else if (!strcmp(argv[optind], "super" )) isServer = isManager = 1;
274 else Say.Say("Config warning: unrecognized parameter, ",
275 argv[optind],", ignored.");
276 }
277
278// Bail if no configuration file specified
279//
280 inArgv = argv; inArgc = argc;
281 if ((!(ConfigFN = cfn) && !(ConfigFN = getenv("XrdCmsCONFIGFN")))
282 || !*ConfigFN)
283 {Say.Emsg("Config", "Required config file not specified.");
284 Usage(1);
285 }
286
287// Establish my instance name
288//
289 sprintf(buff, "%s@%s", XrdOucUtils::InstName(myInsName), myName);
290 myInstance = strdup(buff);
291
292// This is somewhat poor but we need to establish the default non-blocking
293// message queue limit for the cms (this being 30) which can be overriden.
294//
295 XrdSendQ::SetQM(30);
296
297// Print herald
298//
299 Say.Say("++++++ ", myInstance, " phase 1 initialization started.");
300
301// If we don't know our role yet then we must find out before processing the
302// config file. This means a double scan, sigh.
303//
304 if (!(isManager || isServer))
305 if (!(NoGo |= ConfigProc(1)) && !(isManager || isServer))
306 {Say.Say("Config warning: role not specified; manager role assumed.");
307 isManager = -1;
308 }
309
310// Process the configuration file
311//
312 if (!NoGo) NoGo |= ConfigProc();
313
314// Override the trace option
315//
316 if (getenv("XRDDEBUG")) Trace.What = TRACE_ALL;
317
318// Override the wait/nowait from the command line
319//
320 if (immed) doWait = (immed > 0 ? 0 : 1);
321
322// Determine the role
323//
324 if (isManager < 0) isManager = 1;
325 if (isPeer < 0) isPeer = 1;
326 if (isProxy < 0) isProxy = 1;
327 if (isServer < 0) isServer = 1;
328
329// Create a text description of our role for use in messages
330//
331 if (!myRole)
333 if (isMeta) rid = XrdCmsRole::MetaManager;
334 else if (isPeer) rid = XrdCmsRole::Peer;
335 else if (isProxy)
336 {if (isManager) rid = (isServer ? XrdCmsRole::ProxySuper
338 else rid = XrdCmsRole::ProxyServer;
339 }
340 else if (isManager)
341 {if (isManager) rid = (isServer ? XrdCmsRole::Supervisor
343 }
344 else rid = XrdCmsRole::Server;
345 strcpy(myRType, XrdCmsRole::Type(rid));
346 myRole = strdup(XrdCmsRole::Name(rid));
347 myRoleID = static_cast<int>(rid);
348 }
349
350// Export the role IN basic form and expanded form
351//
352 XrdOucEnv::Export("XRDROLE", myRole);
353 XrdOucEnv::Export("XRDROLETYPE", myRType);
354
355// For managers, make sure that we have a well designated port.
356// For servers or supervisors, force an ephemeral port to be used.
357//
358 if (!NoGo)
359 {if ((isManager && !isServer) || isPeer)
360 {if (PortTCP <= 0)
361 {Say.Emsg("Config","port for this", myRole, "not specified.");
362 NoGo = 1;
363 }
364 }
365 else if ((isManager && isServer)) PortTCP = PortSUP;
366 else PortTCP = 0;
367 }
368
369// If we are configured in proxy mode then we are running a shared filesystem
370//
372 (baseFS.Local() ? XrdCmsBaseFS::Cntrl : 0), 0, 0);
373
374// If we are a server and some scheduling parameters were specified but
375// nothing to feed them, give a warning.
376//
377 if (isServer)
379 {if (!prfLib && !perfpgm)
380 Say.Say("Config warning: metric scheduling requested without a "
381 "metrics supplier!");
382 } else {
383 if ( prfLib || perfpgm)
384 Say.Say("Config warning: metrics supplier specified without "
385 "any scheduling metrics!");
386 }
387 }
388
389// Determine how we ended and return status
390//
391 sprintf(buff, " phase 1 %s initialization %s.", myRole,
392 (NoGo ? "failed" : "completed"));
393 Say.Say("------ ", myInstance, buff);
394 return NoGo;
395}
int optopt
int optind
static const int Immed
void Init(int Opts, int DMlife, int DPLife)
static const int Cntrl
static const int DFSys
const char * myInstance
static const char * Name(RoleID rid)
Definition XrdCmsRole.hh:63
static const char * Type(RoleID rid)
Definition XrdCmsRole.hh:78
static int Export(const char *Var, const char *Val)
Definition XrdOucEnv.cc:170
static void SetQM(unsigned int qmVal)
Definition XrdSendQ.hh:56
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)
XrdCmsBaseFS baseFS

References XrdCms::baseFS, XrdCmsBaseFS::Cntrl, ConfigFN, XrdCmsBaseFS::DFSys, doWait, XrdSysError::Emsg(), XrdOucEnv::Export(), XrdCmsBaseFS::Immed, XrdCmsBaseFS::Init(), XrdOucUtils::InstName(), XrdCmsBaseFS::Local(), XrdCmsRole::Manager, XrdCmsRole::MetaManager, myInsName, myInstance, myName, myRole, myRoleID, myRType, XrdCmsRole::Name(), XrdCmsRole::noRole, optind, optopt, P_cpu, P_io, P_load, P_mem, P_pag, XrdCmsRole::Peer, PortSUP, PortTCP, prfLib, XrdCmsRole::ProxyManager, XrdCmsRole::ProxyServer, XrdCmsRole::ProxySuper, XrdCms::Say, XrdSysError::Say(), XrdCmsRole::Server, XrdSendQ::SetQM(), XrdCmsRole::Supervisor, XrdCms::Trace, TRACE_ALL, XrdCmsRole::Type(), and XrdSysTrace::What.

Referenced by XrdgetProtocolPort().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Configure2()

int XrdCmsConfig::Configure2 ( )

Definition at line 401 of file XrdCmsConfig.cc.

402{
403/*
404 Function: Establish phase 2 configuration at start up time.
405
406 Input: None.
407
408 Output: 0 upon success or !0 otherwise.
409*/
410 int Who, NoGo = 0;
411 char *p, buff[512];
412 std::string envData;
413
414// Add our host name to the env
415//
416 envData += "myHN=";
417 envData += myName;
418
419// Print herald
420//
421 sprintf(buff, " phase 2 %s initialization started.", myRole);
422 Say.Say("++++++ ", myInstance, buff);
423
424// Fix up the QryMinum (we hard code 64 as the max) and P_gshr values.
425// The QryMinum only applies to a metamanager and is set as 1 minus the min.
426//
427 if (!isMeta) QryMinum = 0;
428 else if (QryMinum < 2) QryMinum = 0;
429 else if (QryMinum > 64) QryMinum = 64;
430 if (P_gshr < 0) P_gshr = 0;
431 else if (P_gshr > 100) P_gshr = 100;
432
433// Determine who we are. If we are a manager or supervisor start the file
434// location cache scrubber.
435//
436 if (QryDelay < 0) QryDelay = LUPDelay;
437 if (isManager)
438 NoGo = !Cache.Init(cachelife,LUPDelay,QryDelay,baseFS.isDFS(),emptylife);
439
440// Issue warning if the adminpath resides in /tmp
441//
442 if (!strncmp(AdminPath, "/tmp/", 5))
443 Say.Say("Config warning: adminpath resides in /tmp and may be unstable!");
444
445
446// Establish the path to be used for admin functions. It has already been
447// qualified by the instance name.
448//
449 p = XrdOucUtils::genPath(AdminPath, (const char *)0, ".olb");
450 free(AdminPath);
451 AdminPath = p;
452
453// Setup the admin path (used in all roles)
454//
455 if (!NoGo) NoGo = !(AdminSock = XrdNetSocket::Create(&Say, AdminPath,
456 (isManager|isPeer ? "olbd.nimda":"olbd.admin"),AdminMode));
457
458// Develop a stable unique identifier for this cmsd independent of the port
459//
460 if (!NoGo)
461 {if (!(mySID = setupSid())) NoGo = 1;
462 else {if (QTRACE(Debug))
463 Say.Say("Config ", "Global System Identification: ", mySID);
464 if (Config.mySite)
465 {envData += "&site=";
466 envData += mySite;
467 }
468 }
469 }
470
471// Create envCGI string for logins
472//
473 envCGI = (envData.length() > 0 ? strdup(envData.c_str()) : 0);
474
475// If we need a name library, load it now
476//
477 if ((LocalRoot || RemotRoot || N2N_Lib) && ConfigN2N()) NoGo = 1;
478
479// Configure the OSS, the base filesystem, and initialize the prep queue
480//
481 if (!NoGo) NoGo = ConfigOSS();
482 if (!NoGo) baseFS.Start();
483 if (!NoGo) PrepQ.Init();
484
485// Setup manager or server, as needed
486//
487 if (!NoGo && isManager) NoGo = setupManager();
488 if (!NoGo && (isServer || ManList)) NoGo = setupServer();
489
490// If we are a solo peer then we have no servers and a lot of space and
491// connections don't matter. Only one connection matters for a meta-manager.
492// Servers, supervisors, and managers who have a meta manager must wait for
493// for the local data server to connect so port mapping occurs. Otherwise,
494// we indicate that it doesn't matter as the local server won't connect.
495//
496 if (isPeer && isSolo)
498 else if (isManager)
500 if (isMeta) {SUPCount = 1; SUPLevel = 0;}
502 }
503 if (isManager) Who = (isServer ? -1 : 1);
504 else Who = 0;
505 CmsState.Set(SUPCount, Who, AdminPath);
506
507// At this point we will add to the existing manifest file
508//
509 if (!NoGo) NoGo |= Manifest();
510
511// All done, check for success or failure
512//
513 sprintf(buff, " phase 2 %s initialization %s.", myRole,
514 (NoGo ? "failed" : "completed"));
515 Say.Say("------ ", myInstance, buff);
516
517// The remainder of the configuration needs to be run in a separate thread
518//
519 if (!NoGo) Sched->Schedule((XrdJob *)this);
520
521// All done
522//
523 return NoGo;
524}
#define QTRACE(act)
bool Debug
int Init(int fxHold, int fxDelay, int fxQuery, int seFS, int nxHold)
XrdNetSocket * AdminSock
const char * mySite
XrdOucTList * ManList
const char * mySID
void setVirtual(vType vVal)
void Update(StateType StateT, int ActivVal, int StageVal=0)
void Set(int ncount)
static XrdNetSocket * Create(XrdSysError *Say, const char *path, const char *fn, mode_t mode, int isudp=0)
void Schedule(XrdJob *jp)
XrdCmsMeter Meter
XrdCmsCache Cache
XrdCmsState CmsState
XrdCmsPrepare PrepQ
XrdCmsConfig Config

References AdminSock, XrdCms::baseFS, XrdCms::Cache, XrdCms::CmsState, XrdCms::Config, XrdNetSocket::Create(), Debug, envCGI, XrdCmsState::FrontEnd, XrdOucUtils::genPath(), XrdCmsPrepare::Init(), XrdCmsCache::Init(), XrdCmsBaseFS::isDFS(), LocalRoot, LUPDelay, XrdCmsMeter::manFS, ManList, XrdCms::Meter, myInstance, myName, myRole, mySID, mySite, N2N_Lib, P_gshr, XrdCmsMeter::peerFS, XrdCms::PrepQ, QryDelay, QryMinum, QTRACE, RemotRoot, XrdCms::Say, XrdSysError::Say(), XrdCms::Sched, XrdScheduler::Schedule(), XrdCmsState::Set(), XrdCmsMeter::setVirtual(), XrdCmsBaseFS::Start(), SUPCount, SUPLevel, and XrdCmsState::Update().

Referenced by XrdgetProtocol().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ConfigXeq()

int XrdCmsConfig::ConfigXeq ( char *  var,
XrdOucStream CFile,
XrdSysError eDest 
)

Definition at line 530 of file XrdCmsConfig.cc.

531{
532 int dynamic;
533
534 // Determine whether is is dynamic or not
535 //
536 if (eDest) dynamic = 1;
537 else {dynamic = 0; eDest = &Say;}
538
539 // Process items
540 //
541 TS_Xeq("delay", xdelay); // Manager, dynamic
542 TS_Xeq("fxhold", xfxhld); // Manager, dynamic
543 TS_Xeq("ping", xping); // Manager, dynamic
544 TS_Xeq("sched", xsched); // Any, dynamic
545 TS_Xeq("space", xspace); // Any, dynamic
546 TS_Xeq("trace", xtrace); // Any, dynamic
547
548 if (!dynamic)
549 {
550 TS_Xeq("adminpath", xapath); // Any, non-dynamic
551 TS_Xeq("allow", xallow); // Manager, non-dynamic
552 TS_Xeq("altds", xaltds); // Server, non-dynamic
553 TS_Xeq("blacklist", xblk); // Manager, non-dynamic
554 TS_Xeq("cidtag", xcid); // Any, non-dynamic
555 TS_Xeq("defaults", xdefs); // Server, non-dynamic
556 TS_Xeq("dfs", xdfs); // Any, non-dynamic
557 TS_Xeq("export", xexpo); // Any, non-dynamic
558 TS_Xeq("fsxeq", xfsxq); // Server, non-dynamic
559 TS_Xeq("localroot", xlclrt); // Any, non-dynamic
560 TS_Xeq("manager", xmang); // Server, non-dynamic
561 TS_Xeq("mode", xmode); // Manager, non-dynamic
562 TS_Lib("namelib", N2N_Lib, &N2N_Parms);
563 TS_Xeq("nbsendq", xnbsq); // Any non-dynamic
564 TS_Lib("osslib", ossLib, &ossParms);
565 TS_Xeq("perf", xperf); // Server, non-dynamic
566 TS_Xeq("prep", xprep); // Any, non-dynamic
567 TS_Xeq("prepmsg", xprepm); // Any, non-dynamic
568 TS_Xeq("remoteroot", xrmtrt); // Any, non-dynamic
569 TS_Xeq("repstats", xreps); // Any, non-dynamic
570 TS_Xeq("role", xrole); // Server, non-dynamic
571 TS_Xeq("seclib", xsecl); // Server, non-dynamic
572 TS_Xeq("subcluster", xsubc); // Manager, non-dynamic
573 TS_Xeq("superport", xsupp); // Super, non-dynamic
574 TS_Xeq("vnid", xvnid); // Server, non-dynamic
575 TS_Set("wait", doWait); // Server, non-dynamic (backward compat)
576 TS_unSet("nowait", doWait); // Server, non-dynamic
577 TS_Xer("whitelist", xblk,true);//Manager, non-dynamic
578 }
579
580 // The following are client directives that we will ignore
581 //
582 if (!strcmp(var, "conwait")
583 || !strcmp(var, "request")) return 0;
584
585 // No match found, complain.
586 //
587 if (!strcmp(var, "pidpath"))
588 {Say.Say("Config warning: 'cms.pidpath' no longer "
589 "supported; use 'all.pidpath'.");
590 } else {
591 Say.Say("Config warning: ignoring unknown directive '", var, "'.");
592 }
593 CFile.Echo(false);
594 return 0;
595}
#define TS_Set(x, v)
#define TS_Lib(x, y, z)
#define TS_Xer(x, m, v)
#define TS_unSet(x, v)
#define TS_Xeq(x, m)
Definition XrdConfig.cc:156
static XrdSysError eDest(0,"crypto_")

References doWait, XrdOucStream::Echo(), eDest, N2N_Lib, N2N_Parms, ossLib, ossParms, XrdCms::Say, XrdSysError::Say(), TS_Lib, TS_Set, TS_unSet, TS_Xeq, and TS_Xer.

+ Here is the call graph for this function:

◆ DoIt()

void XrdCmsConfig::DoIt ( )
virtual

Implements XrdJob.

Definition at line 601 of file XrdCmsConfig.cc.

602{
603 XrdSysSemaphore SyncUp(0);
604 pthread_t tid;
605 time_t eTime = time(0);
606 int wTime;
607
608// Set doWait correctly. We only wait if we have to provide a data path. This
609// include server, supervisors, and managers who have a meta-manager, only.
610// Why? Because we never get a primary login if we are a mere manager.
611//
612 if (isManager && !isServer && !ManList) doWait = 0;
613 else if (isServer && adsMon) doWait = 1;
614
615// Start the notification thread if we need to
616//
617 if (AnoteSock)
619 0, "Notification handler"))
620 Say.Emsg("cmsd", errno, "start notification handler");
621
622// Start the prepare handler
623//
625 (void *)0, 0, "Prep handler"))
626 Say.Emsg("cmsd", errno, "start prep handler");
627
628// Start the supervisor subsystem
629//
632 (void *)0, 0, "supervisor"))
633 {Say.Emsg("cmsd", errno, "start", myRole);
634 return;
635 }
636 }
637
638// Start the ping clock if we are a manager of any kind
639//
640 if (isManager) PingClock::Start();
641
642// Start the admin thread if we need to, we will not continue until told
643// to do so by the admin interface.
644//
645 if (AdminSock)
646 {XrdCmsAdmin::setSync(&SyncUp);
648 0, "Admin traffic"))
649 Say.Emsg("cmsd", errno, "start admin handler");
650 SyncUp.Wait();
651 }
652
653// Start the manager subsystem.
654//
655 if (isManager || isServer || isPeer) XrdCmsManager::Start(ManList);
656
657// Start state monitoring thread
658//
659 if (XrdSysThread::Run(&tid, XrdCmsStartMonStat, (void *)0,
660 0, "State monitor"))
661 {Say.Emsg("Config", errno, "create state monitor thread");
662 return;
663 }
664
665// If we are a manager then we must do a service enable after a service delay
666//
667 if ((isManager || isPeer) && SRVDelay)
668 {wTime = SRVDelay - static_cast<int>((time(0) - eTime));
669 if (wTime > 0) XrdSysTimer::Wait(wTime*1000);
670 }
671
672// All done
673//
676 Say.Emsg("Config", myRole, "service enabled.");
677}
void * XrdCmsStartSupervising(void *carg)
void * XrdCmsStartAnote(void *carg)
void * XrdCmsStartPreparing(void *carg)
void * XrdCmsStartMonStat(void *carg)
void * XrdCmsStartAdmin(void *carg)
static void setSync(XrdSysSemaphore *sync)
XrdNetSocket * AnoteSock
static bool Start(const XrdOucTList *mL)
void Enable()
static void Start()
static int Run(pthread_t *, void *(*proc)(void *), void *arg, int opts=0, const char *desc=0)
static void Wait(int milliseconds)

References AdminSock, adsMon, AnoteSock, XrdCms::CmsState, XrdCmsState::Counts, doWait, XrdSysError::Emsg(), XrdCmsState::Enable(), ManList, myRole, XrdSysThread::Run(), XrdCms::Say, XrdCmsAdmin::setSync(), SRVDelay, XrdCms::PingClock::Start(), XrdCmsManager::Start(), SUPCount, XrdCmsSupervisor::superOK, XrdCmsState::Update(), XrdSysSemaphore::Wait(), XrdSysTimer::Wait(), XrdCmsStartAdmin(), XrdCmsStartAnote(), XrdCmsStartMonStat(), XrdCmsStartPreparing(), and XrdCmsStartSupervising().

+ Here is the call graph for this function:

◆ GenLocalPath()

int XrdCmsConfig::GenLocalPath ( const char *  oldp,
char *  newp 
)

Definition at line 688 of file XrdCmsConfig.cc.

689{
690 if (lcl_N2N) return -(lcl_N2N->lfn2pfn(oldp, newp, XrdCmsMAX_PATH_LEN));
691 if (strlen(oldp) >= XrdCmsMAX_PATH_LEN) return -ENAMETOOLONG;
692 strcpy(newp, oldp);
693 return 0;
694}
#define XrdCmsMAX_PATH_LEN
XrdOucName2Name * lcl_N2N
virtual int lfn2pfn(const char *lfn, char *buff, int blen)=0

References lcl_N2N, XrdOucName2Name::lfn2pfn(), and XrdCmsMAX_PATH_LEN.

+ Here is the call graph for this function:

Member Data Documentation

◆ AdminSock

XrdNetSocket* XrdCmsConfig::AdminSock

Definition at line 198 of file XrdCmsConfig.hh.

Referenced by Configure2(), and DoIt().

◆ adsMon

int XrdCmsConfig::adsMon

Definition at line 139 of file XrdCmsConfig.hh.

Referenced by DoIt().

◆ adsPort

int XrdCmsConfig::adsPort

Definition at line 138 of file XrdCmsConfig.hh.

Referenced by XrdCmsAdmin::MonAds(), and XrdCmsAdmin::Start().

◆ adsProt

char* XrdCmsConfig::adsProt

Definition at line 140 of file XrdCmsConfig.hh.

◆ AnoteSock

XrdNetSocket* XrdCmsConfig::AnoteSock

Definition at line 199 of file XrdCmsConfig.hh.

Referenced by DoIt().

◆ AskPerf

int XrdCmsConfig::AskPerf

Definition at line 92 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::MonPerf().

◆ AskPing

int XrdCmsConfig::AskPing

◆ cidTag

char* XrdCmsConfig::cidTag

Definition at line 180 of file XrdCmsConfig.hh.

◆ ConfigFN

char* XrdCmsConfig::ConfigFN

Definition at line 154 of file XrdCmsConfig.hh.

Referenced by Configure1(), and XrdCmsMeter::Monitor().

◆ DELDelay

int XrdCmsConfig::DELDelay

Definition at line 75 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::Delete().

◆ DirFlags

unsigned long long XrdCmsConfig::DirFlags

Definition at line 195 of file XrdCmsConfig.hh.

◆ DiskAsk

int XrdCmsConfig::DiskAsk

Definition at line 121 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::Init().

◆ DiskHWM

int XrdCmsConfig::DiskHWM

Definition at line 117 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::Init().

◆ DiskHWMP

short XrdCmsConfig::DiskHWMP

Definition at line 119 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::Init().

◆ DiskLinger

int XrdCmsConfig::DiskLinger

Definition at line 120 of file XrdCmsConfig.hh.

◆ DiskMin

int XrdCmsConfig::DiskMin

Definition at line 116 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Load(), and XrdCmsMeter::Init().

◆ DiskMinP

short XrdCmsConfig::DiskMinP

Definition at line 118 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::Init().

◆ DiskOK

◆ DiskSS

bool XrdCmsConfig::DiskSS

◆ DiskWT

int XrdCmsConfig::DiskWT

Definition at line 122 of file XrdCmsConfig.hh.

◆ DoHnTry

char XrdCmsConfig::DoHnTry

Definition at line 112 of file XrdCmsConfig.hh.

◆ DoMWChk

char XrdCmsConfig::DoMWChk

Definition at line 111 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Select().

◆ doWait

int XrdCmsConfig::doWait

◆ DRPDelay

int XrdCmsConfig::DRPDelay

◆ envCGI

char* XrdCmsConfig::envCGI

Definition at line 179 of file XrdCmsConfig.hh.

Referenced by Configure2().

◆ forceRO

bool XrdCmsConfig::forceRO

Definition at line 126 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Select().

◆ ifList

const char* XrdCmsConfig::ifList

Definition at line 181 of file XrdCmsConfig.hh.

◆ lcl_N2N

XrdOucName2Name* XrdCmsConfig::lcl_N2N

Definition at line 152 of file XrdCmsConfig.hh.

Referenced by GenLocalPath().

◆ LocalRoot

char* XrdCmsConfig::LocalRoot

Definition at line 163 of file XrdCmsConfig.hh.

Referenced by Configure2().

◆ LogPerf

int XrdCmsConfig::LogPerf

Definition at line 95 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::XrdCmsNode(), and XrdCmsNode::do_Load().

◆ LUPDelay

int XrdCmsConfig::LUPDelay

Definition at line 73 of file XrdCmsConfig.hh.

Referenced by Configure2(), XrdCmsCluster::Locate(), and XrdCmsCluster::Select().

◆ LUPHold

int XrdCmsConfig::LUPHold

Definition at line 74 of file XrdCmsConfig.hh.

◆ ManList

XrdOucTList* XrdCmsConfig::ManList

Definition at line 182 of file XrdCmsConfig.hh.

Referenced by Configure2(), and DoIt().

◆ MaxDelay

int XrdCmsConfig::MaxDelay

Definition at line 87 of file XrdCmsConfig.hh.

◆ MaxLoad

int XrdCmsConfig::MaxLoad

Definition at line 86 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Select().

◆ MaxRetries

int XrdCmsConfig::MaxRetries

Definition at line 88 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_SelAvoid().

◆ mrRdrHLen

int XrdCmsConfig::mrRdrHLen

Definition at line 143 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_SelAvoid().

◆ mrRdrHost

char* XrdCmsConfig::mrRdrHost

Definition at line 142 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_SelAvoid().

◆ mrRdrPort

int XrdCmsConfig::mrRdrPort

Definition at line 144 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_SelAvoid().

◆ MsgTTL

int XrdCmsConfig::MsgTTL

Definition at line 89 of file XrdCmsConfig.hh.

◆ msRdrHLen

int XrdCmsConfig::msRdrHLen

Definition at line 146 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_SelAvoid().

◆ msRdrHost

char* XrdCmsConfig::msRdrHost

Definition at line 145 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_SelAvoid().

◆ msRdrPort

int XrdCmsConfig::msRdrPort

Definition at line 147 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_SelAvoid().

◆ MultiSrc

char XrdCmsConfig::MultiSrc

Definition at line 114 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_SelAvoid().

◆ myDomain

const char* XrdCmsConfig::myDomain

Definition at line 173 of file XrdCmsConfig.hh.

Referenced by XrdCmsSupervisor::Init().

◆ myInsName

const char* XrdCmsConfig::myInsName

Definition at line 174 of file XrdCmsConfig.hh.

Referenced by Configure0(), and Configure1().

◆ myInstance

const char* XrdCmsConfig::myInstance

Definition at line 175 of file XrdCmsConfig.hh.

Referenced by Configure1(), and Configure2().

◆ myName

const char* XrdCmsConfig::myName

Definition at line 172 of file XrdCmsConfig.hh.

Referenced by Configure0(), Configure1(), and Configure2().

◆ myPaths

char* XrdCmsConfig::myPaths

Definition at line 165 of file XrdCmsConfig.hh.

◆ myProg

const char* XrdCmsConfig::myProg

Definition at line 171 of file XrdCmsConfig.hh.

Referenced by Configure0().

◆ myRole

char* XrdCmsConfig::myRole

Definition at line 170 of file XrdCmsConfig.hh.

Referenced by Configure1(), Configure2(), and DoIt().

◆ myRoleID

char XrdCmsConfig::myRoleID

Definition at line 168 of file XrdCmsConfig.hh.

Referenced by Configure1().

◆ myRType

char XrdCmsConfig::myRType[4]

Definition at line 169 of file XrdCmsConfig.hh.

Referenced by Configure1(), XrdCmsCluster::Stats(), and XrdCmsCluster::Statt().

◆ mySID

const char* XrdCmsConfig::mySID

Definition at line 176 of file XrdCmsConfig.hh.

Referenced by Configure2().

◆ mySite

const char* XrdCmsConfig::mySite

Definition at line 178 of file XrdCmsConfig.hh.

Referenced by Configure2().

◆ myVInfo

XrdVersionInfo* XrdCmsConfig::myVInfo

Definition at line 149 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::Monitor().

◆ myVNID

const char* XrdCmsConfig::myVNID

Definition at line 177 of file XrdCmsConfig.hh.

◆ N2N_Lib

char* XrdCmsConfig::N2N_Lib

Definition at line 161 of file XrdCmsConfig.hh.

Referenced by Configure2(), and ConfigXeq().

◆ N2N_Parms

char* XrdCmsConfig::N2N_Parms

Definition at line 162 of file XrdCmsConfig.hh.

Referenced by ConfigXeq().

◆ NanList

XrdOucTList* XrdCmsConfig::NanList

Definition at line 183 of file XrdCmsConfig.hh.

◆ nbSQ

char XrdCmsConfig::nbSQ

Definition at line 113 of file XrdCmsConfig.hh.

◆ NetTCP

XrdInet* XrdCmsConfig::NetTCP

Definition at line 99 of file XrdCmsConfig.hh.

Referenced by XrdgetProtocol().

◆ ossFS

◆ ossLib

char* XrdCmsConfig::ossLib

Definition at line 155 of file XrdCmsConfig.hh.

Referenced by ConfigXeq().

◆ ossParms

char* XrdCmsConfig::ossParms

Definition at line 156 of file XrdCmsConfig.hh.

Referenced by ConfigXeq().

◆ P_cpu

int XrdCmsConfig::P_cpu

Definition at line 101 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::calcLoad(), and Configure1().

◆ P_dsk

int XrdCmsConfig::P_dsk

Definition at line 102 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::calcLoad().

◆ P_fuzz

int XrdCmsConfig::P_fuzz

Definition at line 103 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::PutInfo(), and XrdCmsMeter::Update().

◆ P_gsdf

int XrdCmsConfig::P_gsdf

Definition at line 104 of file XrdCmsConfig.hh.

◆ P_gshr

int XrdCmsConfig::P_gshr

Definition at line 105 of file XrdCmsConfig.hh.

Referenced by Configure2().

◆ P_io

int XrdCmsConfig::P_io

Definition at line 106 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::calcLoad(), and Configure1().

◆ P_load

int XrdCmsConfig::P_load

Definition at line 107 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::calcLoad(), and Configure1().

◆ P_mem

int XrdCmsConfig::P_mem

Definition at line 108 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::calcLoad(), and Configure1().

◆ P_pag

int XrdCmsConfig::P_pag

Definition at line 109 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::calcLoad(), and Configure1().

◆ PathList

XrdCmsPList_Anchor XrdCmsConfig::PathList

Definition at line 196 of file XrdCmsConfig.hh.

◆ PexpList

XrdOucPListAnchor XrdCmsConfig::PexpList

Definition at line 197 of file XrdCmsConfig.hh.

◆ PingTick

int XrdCmsConfig::PingTick

Definition at line 94 of file XrdCmsConfig.hh.

Referenced by XrdCms::PingClock::DoIt().

◆ Police

XrdNetSecurity* XrdCmsConfig::Police

Definition at line 201 of file XrdCmsConfig.hh.

Referenced by XrdgetProtocol().

◆ PortSUP

int XrdCmsConfig::PortSUP

Definition at line 98 of file XrdCmsConfig.hh.

Referenced by Configure1().

◆ PortTCP

int XrdCmsConfig::PortTCP

◆ prfLib

char* XrdCmsConfig::prfLib

Definition at line 157 of file XrdCmsConfig.hh.

Referenced by Configure1(), and XrdCmsMeter::Monitor().

◆ prfParms

char* XrdCmsConfig::prfParms

Definition at line 158 of file XrdCmsConfig.hh.

Referenced by XrdCmsMeter::Monitor().

◆ ProgCH

XrdOucProg* XrdCmsConfig::ProgCH

Definition at line 187 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Chmod().

◆ ProgMD

XrdOucProg* XrdCmsConfig::ProgMD

Definition at line 188 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Mkdir().

◆ ProgMP

XrdOucProg* XrdCmsConfig::ProgMP

Definition at line 189 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Mkpath().

◆ ProgMV

XrdOucProg* XrdCmsConfig::ProgMV

Definition at line 190 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Mv().

◆ ProgRD

XrdOucProg* XrdCmsConfig::ProgRD

Definition at line 191 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Rmdir().

◆ ProgRM

XrdOucProg* XrdCmsConfig::ProgRM

Definition at line 192 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Rm().

◆ ProgTR

XrdOucProg* XrdCmsConfig::ProgTR

Definition at line 193 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Trunc().

◆ PSDelay

int XrdCmsConfig::PSDelay

Definition at line 77 of file XrdCmsConfig.hh.

◆ QryDelay

int XrdCmsConfig::QryDelay

Definition at line 79 of file XrdCmsConfig.hh.

Referenced by Configure2().

◆ QryMinum

int XrdCmsConfig::QryMinum

Definition at line 80 of file XrdCmsConfig.hh.

Referenced by Configure2(), XrdCmsNode::do_Locate(), and XrdCmsNode::do_Select().

◆ RedirSock

XrdNetSocket* XrdCmsConfig::RedirSock

Definition at line 200 of file XrdCmsConfig.hh.

◆ RefReset

int XrdCmsConfig::RefReset

Definition at line 90 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::MonRefs().

◆ RefTurn

int XrdCmsConfig::RefTurn

Definition at line 91 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::MonRefs().

◆ RemotRoot

char* XrdCmsConfig::RemotRoot

Definition at line 164 of file XrdCmsConfig.hh.

Referenced by Configure2().

◆ RepStat_All

const int XrdCmsConfig::RepStat_All = 0xffff
static

Definition at line 210 of file XrdCmsConfig.hh.

◆ RepStat_frq

const int XrdCmsConfig::RepStat_frq = 0x0001
static

Definition at line 208 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Statt().

◆ RepStat_shr

const int XrdCmsConfig::RepStat_shr = 0x0002
static

Definition at line 209 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Statt().

◆ RepStats

short XrdCmsConfig::RepStats

Definition at line 166 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Statt().

◆ rsvd

char XrdCmsConfig::rsvd[3]

Definition at line 128 of file XrdCmsConfig.hh.

◆ RWDelay

int XrdCmsConfig::RWDelay

Definition at line 78 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Select().

◆ SanList

XrdOucTList* XrdCmsConfig::SanList

Definition at line 184 of file XrdCmsConfig.hh.

◆ sched_AffPC

char XrdCmsConfig::sched_AffPC

Definition at line 132 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Select().

◆ sched_Force

char XrdCmsConfig::sched_Force

Definition at line 134 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Select().

◆ sched_Level

char XrdCmsConfig::sched_Level

Definition at line 133 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Select().

◆ sched_LoadR

char XrdCmsConfig::sched_LoadR

Definition at line 135 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Select().

◆ sched_Pack

char XrdCmsConfig::sched_Pack

Definition at line 131 of file XrdCmsConfig.hh.

Referenced by XrdCmsNode::do_Select().

◆ sched_RR

char XrdCmsConfig::sched_RR

Definition at line 130 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Select().

◆ SRVDelay

int XrdCmsConfig::SRVDelay

Definition at line 81 of file XrdCmsConfig.hh.

Referenced by DoIt().

◆ SUPCount

int XrdCmsConfig::SUPCount

Definition at line 82 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Add(), Configure2(), DoIt(), and XrdCmsSupervisor::Init().

◆ SUPDelay

int XrdCmsConfig::SUPDelay

Definition at line 84 of file XrdCmsConfig.hh.

Referenced by XrdCmsProtocol::Execute().

◆ SUPLevel

int XrdCmsConfig::SUPLevel

Definition at line 83 of file XrdCmsConfig.hh.

Referenced by XrdCmsCluster::Add(), Configure2(), and XrdCmsSupervisor::Init().

◆ SUSDelay

int XrdCmsConfig::SUSDelay

Definition at line 85 of file XrdCmsConfig.hh.

◆ TimeZone

char XrdCmsConfig::TimeZone

Definition at line 167 of file XrdCmsConfig.hh.

◆ VNID_Lib

char* XrdCmsConfig::VNID_Lib

Definition at line 159 of file XrdCmsConfig.hh.

◆ VNID_Parms

char* XrdCmsConfig::VNID_Parms

Definition at line 160 of file XrdCmsConfig.hh.

◆ xeq_N2N

XrdOucName2Name* XrdCmsConfig::xeq_N2N

Definition at line 151 of file XrdCmsConfig.hh.


The documentation for this class was generated from the following files: