Logo ROOT  
Reference Guide
XrdProofdManager.h
Go to the documentation of this file.
1// @(#)root/proofd:$Id$
2// Author: G. 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#ifndef ROOT_XrdProofdManager
13#define ROOT_XrdProofdManager
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// XrdProofdManager //
18// //
19// Author: G. Ganis, CERN, 2007 //
20// //
21// Class mapping manager functionality. //
22// On masters it keeps info about the available worker nodes and allows //
23// communication with them. In particular, it reads the proof.conf file //
24// when working with static resources. //
25// On workers it handles the communication with the master //
26// (to be implemented). //
27// //
28//////////////////////////////////////////////////////////////////////////
29#include <list>
30
31#include "XpdSysPthread.h"
32
33#include "XrdOuc/XrdOucString.hh"
34
35#include "XrdProofdAux.h"
36#include "XrdProofdConfig.h"
37
38class rpdunixsrv;
39class XrdProofdAdmin;
40class XrdProofdClient;
42class XrdProofdNetMgr;
47class XrdProofSched;
49class XrdProofWorker;
50class XrdProtocol;
51class XrdROOT;
52class XrdROOTMgr;
53
54class XrdSysPlugin;
55
57
58 public:
59 XrdProofdManager(char *parms, XrdProtocol_Config *pi, XrdSysError *edest);
60 virtual ~XrdProofdManager();
61
62 XrdSysRecMutex *Mutex() { return &fMutex; }
63
64 // Config
65 int Config(bool rcf = 0);
67 char *val, XrdOucStream *cfg, bool rcf);
68 void RegisterDirectives();
69
70 int ResolveKeywords(XrdOucString &s, XrdProofdClient *pcl);
71
72 int GetWorkers(XrdOucString &workers, XrdProofdProofServ *, const char *);
73
74 const char *AdminPath() const { return fAdminPath.c_str(); }
75 const char *BareLibPath() const { return fBareLibPath.c_str(); }
76 bool ChangeOwn() const { return fChangeOwn; }
78 bool CheckMaster(const char *m);
79 int CheckUser(const char *usr, const char *grp, XrdProofUI &ui, XrdOucString &e, bool &su);
80 int CronFrequency() { return fCronFrequency; }
81 const char *Host() const { return fHost.c_str(); }
82 const char *Image() const { return fImage.c_str(); }
83 bool IsSuperMst() const { return fSuperMst; }
84 const char *LocalROOT() const { return fLocalroot.c_str(); }
85 bool MultiUser() const { return fMultiUser; }
86 const char *NameSpace() const { return fNamespace.c_str(); }
87 const char *PoolURL() const { return fPoolURL.c_str(); }
88 int Port() const { return fPort; }
89 int SrvType() const { return fSrvType; }
90 const char *SockPathDir() const { return fSockPathDir.c_str(); }
91 const char *TMPdir() const { return fTMPdir.c_str(); }
92 const char *WorkDir() const { return fWorkDir.c_str(); }
93 const char *DataDir() const { return fDataDir.c_str(); }
94 const char *DataDirOpts() const { return fDataDirOpts.c_str(); }
95 const char *DataDirUrlOpts() const { return fDataDirUrlOpts.c_str(); }
96 const char *DataSetExp() const { return fDataSetExp.c_str(); }
97 const char *StageReqRepo() const { return fStageReqRepo.c_str(); }
98
99 bool RemotePLite() const { return fRemotePLite; }
100
101 std::list<XrdProofdDSInfo *> *DataSetSrcs() { return &fDataSetSrcs; }
102
103 // Services
105 const char *EffectiveUser() const { return fEffectiveUser.c_str(); }
109 XrdProofdNetMgr *NetMgr() const { return fNetMgr; }
110 XrdProofdAdmin *Admin() const { return fAdmin; }
111 XrdROOTMgr *ROOTMgr() const { return fROOTMgr; }
113 XrdScheduler *Sched() const { return fSched; }
114
115 XrdProtocol *Xrootd() const { return fXrootd; }
116
117 // Request processor
119
120 private:
121 XrdSysRecMutex fMutex; // Atomize this instance
122
123 bool fSuperMst; // true if this node is a SuperMst
124 bool fRemotePLite; // true if remote PLite mode is allowed
125
126 XrdOucString fAdminPath; // Path to the PROOF admin area
127
128 int fSrvType; // Master, Submaster, Worker or any
129 XrdOucString fEffectiveUser; // Effective user
130 XrdOucString fHost; // local host name
131 int fPort; // Port for client-like connections
132 XrdOucString fImage; // image name for these servers
133 XrdOucString fWorkDir; // working dir for these servers
134 XrdOucString fMUWorkDir; // template working dir in multi-user mode
135 int fCronFrequency; // Frequency of cron checks
136
137 XrdOucString fBareLibPath; // LIBPATH cleaned from ROOT dists
138 XrdOucString fSockPathDir; // directory for Unix sockets
139 XrdOucString fTMPdir; // directory for temporary files
140 XrdOucString fPoolURL; // Local pool URL
141 XrdOucString fNamespace; // Local pool namespace
142 XrdOucString fLocalroot; // Local root prefix (directive oss.localroot)
143 XrdOucString fDataDir; // Directory under which to create the sub-dirs for users data
144 XrdOucString fDataDirOpts; // String specifying options for fDataDir handling
145 XrdOucString fDataDirUrlOpts; // String specifying URL type options for fDataDir
146 XrdOucString fDataSetExp; // List of local dataset repositories to be asserted
147 XrdOucString fStageReqRepo; // Directive for staging requests
148
149 XrdProtocol *fXrootd; // Reference instance of XrdXrootdProtocol
150 XrdOucString fXrootdLibPath; // Path to 'xrootd' plug-in
151 XrdSysPlugin *fXrootdPlugin; // 'xrootd' plug-in handler
152
153 // Services
154 XrdProofdClientMgr *fClientMgr; // Client manager
155 XrdProofGroupMgr *fGroupsMgr; // Groups manager
156 XrdProofSched *fProofSched; // Instance of the PROOF scheduler
157 XrdProofdProofServMgr *fSessionMgr; // Proof session manager
158 XrdProofdNetMgr *fNetMgr; // Proof network manager
159 XrdProofdAdmin *fAdmin; // Admin services
160 XrdROOTMgr *fROOTMgr; // ROOT versions manager
162
163 XrdScheduler *fSched; // System scheduler
164
165 XrdOucString fSuperUsers; // ':' separated list of privileged users
166 //
167 int fOperationMode; // Operation mode
168 XrdOucHash<int> fAllowedUsers; // UNIX users allowed in controlled mode
169 XrdOucHash<int> fAllowedGroups; // UNIX groups allowed in controlled mode
170 bool fMultiUser; // Allow/disallow multi-user mode
171 bool fChangeOwn; // TRUE is ownership has to be changed
172
173 // Lib paths for proofserv
174 bool fRemoveROOTLibPaths; // If true the existing ROOT lib paths are removed
175 XrdOucHash<XrdOucString> fLibPathsToRemove; // Additional paths to be removed
176
177 //
178 // Lists
179 std::list<XrdOucString *> fMastersAllowed; // list of master (domains) allowed
180 std::list<XrdProofdDSInfo *> fDataSetSrcs; // sources of dataset info
181
182 // Temporary storage: not to be trusted after construction
183 char *fParms;
184 XrdProtocol_Config *fPi;
185
186
187 int DoDirectiveAllow(char *, XrdOucStream *, bool);
188 int DoDirectiveAllowedGroups(char *, XrdOucStream *, bool);
189 int DoDirectiveAllowedUsers(char *, XrdOucStream *, bool);
190 int DoDirectiveDataDir(char *, XrdOucStream *, bool);
191 int DoDirectiveDataSetSrc(char *, XrdOucStream *, bool);
192 int DoDirectiveDataSetReqRepo(char *, XrdOucStream *, bool);
193 int DoDirectiveFilterLibPaths(char *, XrdOucStream *, bool);
194 int DoDirectiveGroupfile(char *, XrdOucStream *, bool);
195 int DoDirectiveMaxOldLogs(char *, XrdOucStream *, bool);
196 int DoDirectiveMultiUser(char *, XrdOucStream *, bool);
197 int DoDirectivePort(char *, XrdOucStream *, bool);
198 int DoDirectiveRole(char *, XrdOucStream *, bool);
199 int DoDirectiveRootd(char *, XrdOucStream *, bool);
200 int DoDirectiveRootdAllow(char *, XrdOucStream *, bool);
201 int DoDirectiveTrace(char *, XrdOucStream *, bool);
202 int DoDirectiveXrootd(char *, XrdOucStream *, bool);
203
204 bool ValidateLocalDataSetSrc(XrdOucString &url, bool &local);
205
206 // Load services
208 XrdProtocol *LoadXrootd(char *parms, XrdProtocol_Config *pi, XrdSysError *edest);
209};
210
211// Aux structures
212typedef struct {
217
218#endif
#define d(i)
Definition: RSha256.hxx:102
#define e(i)
Definition: RSha256.hxx:103
#define XrdSysError
Definition: XpdSysError.h:8
#define XrdSysPlugin
Definition: XpdSysPlugin.h:8
#define XrdSysRecMutex
Definition: XrdSysToOuc.h:18
int DoDirectiveRootd(char *, XrdOucStream *, bool)
Process 'rootd' directive xpd.rootd deny|allow [rootsys:<tag>] [path:abs-path/] [mode:ro|rw] [auth:no...
int GetWorkers(XrdOucString &workers, XrdProofdProofServ *, const char *)
Get a list of workers from the available resource broker.
XrdProofdPriorityMgr * PriorityMgr() const
const char * PoolURL() const
XrdProofdAdmin * fAdmin
XrdProofSched * ProofSched() const
bool ChangeOwn() const
XrdProofdPriorityMgr * fPriorityMgr
const char * SockPathDir() const
XrdProofdAdmin * Admin() const
XrdOucString fImage
int DoDirectiveRole(char *, XrdOucStream *, bool)
Process 'role' directive.
XrdProtocol_Config * fPi
const char * DataDirUrlOpts() const
XrdOucString fWorkDir
int DoDirectiveDataSetSrc(char *, XrdOucStream *, bool)
Process 'datasetsrc' directive.
XrdROOTMgr * ROOTMgr() const
XrdProofdProofServMgr * fSessionMgr
std::list< XrdProofdDSInfo * > * DataSetSrcs()
XrdOucString fStageReqRepo
int DoDirective(XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
Update the priorities of the active sessions.
XrdOucString fSockPathDir
const char * DataDirOpts() const
XrdProofdNetMgr * NetMgr() const
int Process(XrdProofdProtocol *p)
Process manager request.
XrdProofSched * LoadScheduler()
Load PROOF scheduler.
virtual ~XrdProofdManager()
Destructor.
XrdOucString fDataDir
XrdProofGroupMgr * GroupsMgr() const
XrdOucString fDataDirUrlOpts
XrdProtocol * Xrootd() const
int DoDirectiveMaxOldLogs(char *, XrdOucStream *, bool)
Process 'maxoldlogs' directive.
XrdScheduler * Sched() const
int DoDirectiveDataSetReqRepo(char *, XrdOucStream *, bool)
int DoDirectiveAllowedGroups(char *, XrdOucStream *, bool)
Process 'allowedgroups' directive.
bool IsSuperMst() const
XrdROOTMgr * fROOTMgr
const char * DataSetExp() const
bool MultiUser() const
int DoDirectiveMultiUser(char *, XrdOucStream *, bool)
Process 'multiuser' directive.
XrdOucString fAdminPath
XrdProofdClientMgr * ClientMgr() const
XrdProofGroupMgr * fGroupsMgr
XrdOucString fTMPdir
const char * LocalROOT() const
XrdOucString fEffectiveUser
const char * Host() const
int DoDirectiveFilterLibPaths(char *, XrdOucStream *, bool)
Process 'filterlibpaths' directive xpd.filterlibpaths 1|0 [path1,path2 path3 path4 ....
int DoDirectivePort(char *, XrdOucStream *, bool)
Process 'xrd.protocol' directive to find the port.
XrdSysRecMutex fMutex
const char * StageReqRepo() const
XrdOucString fLocalroot
const char * BareLibPath() const
XrdOucHash< int > fAllowedGroups
const char * Image() const
XrdOucString fPoolURL
XrdProtocol * fXrootd
XrdProofdNetMgr * fNetMgr
int DoDirectiveDataDir(char *, XrdOucStream *, bool)
Process 'datadir' directive.
void CheckLogFileOwnership()
Make sure that the log file belongs to the original effective user.
bool RemotePLite() const
XrdSysPlugin * fXrootdPlugin
const char * DataDir() const
int DoDirectiveRootdAllow(char *, XrdOucStream *, bool)
Process 'rootdallow' directive xpd.rootdallow host1,host2 host3 Host names may contain the wild card ...
XrdOucHash< int > fAllowedUsers
bool CheckMaster(const char *m)
Check if master 'm' is allowed to connect to this host.
void RegisterDirectives()
Register directives for configuration.
const char * NameSpace() const
XrdOucHash< XrdOucString > fLibPathsToRemove
XrdProtocol * LoadXrootd(char *parms, XrdProtocol_Config *pi, XrdSysError *edest)
Load the Xrootd protocol, if required.
XrdProofdManager(char *parms, XrdProtocol_Config *pi, XrdSysError *edest)
Constructor.
XrdOucString fBareLibPath
const char * TMPdir() const
XrdOucString fDataSetExp
int DoDirectiveGroupfile(char *, XrdOucStream *, bool)
Process 'groupfile' directive.
int SrvType() const
const char * EffectiveUser() const
int DoDirectiveTrace(char *, XrdOucStream *, bool)
Scan the config file for tracing settings.
XrdOucString fNamespace
XrdScheduler * fSched
std::list< XrdProofdDSInfo * > fDataSetSrcs
int DoDirectiveAllowedUsers(char *, XrdOucStream *, bool)
Process 'allowedusers' directive.
std::list< XrdOucString * > fMastersAllowed
const char * WorkDir() const
int CheckUser(const char *usr, const char *grp, XrdProofUI &ui, XrdOucString &e, bool &su)
Check if the user is allowed to use the system Return 0 if OK, -1 if not.
XrdSysRecMutex * Mutex()
XrdOucString fDataDirOpts
XrdProofdProofServMgr * SessionMgr() const
bool ValidateLocalDataSetSrc(XrdOucString &url, bool &local)
Validate local dataset src at URL (check the URL and make the relevant directories).
XrdOucString fHost
const char * AdminPath() const
int Config(bool rcf=0)
Run configuration and parse the entered config directives.
XrdProofSched * fProofSched
XrdOucString fXrootdLibPath
int DoDirectiveXrootd(char *, XrdOucStream *, bool)
Process 'xrootd' directive xpd.xrootd [path/]libXrdXrootd.so.
XrdOucString fSuperUsers
XrdProofdClientMgr * fClientMgr
XrdOucString fMUWorkDir
int DoDirectiveAllow(char *, XrdOucStream *, bool)
Process 'allow' directive.
int ResolveKeywords(XrdOucString &s, XrdProofdClient *pcl)
Resolve special keywords in 's' for client 'pcl'.
static constexpr double s
static constexpr double pi
XrdProofdProofServMgr * fSessionMgr
XrdProofdClientMgr * fClientMgr
XrdProofSched * fProofSched
auto * m
Definition: textangle.C:8