ROOT  6.06/09
Reference Guide
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
XrdProofdProofServMgr Class Reference

Definition at line 130 of file XrdProofdProofServMgr.h.

Public Types

enum  PSMProtocol {
  kSessionRemoval = 0, kClientDisconnect = 1, kCleanSessions = 2, kProcessReq = 3,
  kChgSessionSt = 4
}
 
enum  PSMCounters { kCreateCnt = 0, kCleanSessionsCnt = 1, kProcessCnt = 2 }
 

Public Member Functions

 XrdProofdProofServMgr (XrdProofdManager *mgr, XrdProtocol_Config *pi, XrdSysError *e)
 Constructor. More...
 
virtual ~XrdProofdProofServMgr ()
 
XrdSysRecMutexMutex ()
 
int Config (bool rcf=0)
 Run configuration and parse the entered config directives. More...
 
int DoDirective (XrdProofdDirective *d, char *val, XrdOucStream *cfg, bool rcf)
 Update the priorities of the active sessions. More...
 
void RegisterDirectives ()
 Register directives for configuration. More...
 
int CheckFrequency () const
 
int InternalWait () const
 
int VerifyTimeOut () const
 
int NextSessionsCheck ()
 
void SetNextSessionsCheck (int t)
 
bool IsReconnecting ()
 Return true if in reconnection state, i.e. More...
 
bool IsClientRecovering (const char *usr, const char *grp, int &deadline)
 Returns true (an the recovering deadline) if the client has sessions in recovering state; returns false otherwise. More...
 
void SetReconnectTime (bool on=1)
 Change reconnecting status. More...
 
bool Alive (XrdProofdProtocol *p)
 Check destroyed status. More...
 
int Process (XrdProofdProtocol *p)
 Process manager request. More...
 
XrdSysSemWaitProcessSem ()
 
int AcceptPeer (XrdProofdProofServ *xps, int to, XrdOucString &e)
 Accept a callback from a starting-up server and setup the related protocol object. More...
 
int Attach (XrdProofdProtocol *p)
 Handle a request to attach to an existing session. More...
 
int Create (XrdProofdProtocol *p)
 Handle a request to create a new session. More...
 
int Destroy (XrdProofdProtocol *p)
 Handle a request to shutdown an existing session. More...
 
int Detach (XrdProofdProtocol *p)
 Handle a request to detach from an existing session. More...
 
int Recover (XpdClientSessions *cl)
 Handle a request to recover a session after stop&restart for a specific client. More...
 
void UpdateCounter (int t, int n)
 
int CheckCounter (int t)
 
void BroadcastClusterInfo ()
 Broadcast cluster info to the active sessions. More...
 
int BroadcastPriorities ()
 Broadcast priorities to the active sessions. More...
 
int CurrentSessions (bool recalculate=0)
 Return the number of current sessions (top masters) More...
 
void DisconnectFromProofServ (int pid)
 Change reconnecting status. More...
 
std::list< XrdProofdProofServ * > * ActiveSessions ()
 
XrdProofdProofServGetActiveSession (int pid)
 Return active session with process ID pid, if any. More...
 
int CleanupProofServ (bool all=0, const char *usr=0)
 Cleanup (kill) all 'proofserv' processes from the process table. More...
 
void FormFileNameInSessionDir (XrdProofdProtocol *p, XrdProofdProofServ *xps, const char *sessiondir, const char *extension, XrdOucString &outfn)
 
void GetTagDirs (int opt, XrdProofdProtocol *p, XrdProofdProofServ *xps, XrdOucString &sesstag, XrdOucString &topsesstag, XrdOucString &sessiondir, XrdOucString &sesswrkdir)
 Determine the unique tag and relevant dirs for this session. More...
 
int SetProofServEnv (XrdProofdProtocol *p, void *in)
 Set environment for proofserv. More...
 
int SetProofServEnvOld (XrdProofdProtocol *p, void *in)
 Set environment for proofserv; old version preparing the environment for proofserv protocol version <= 13. More...
 
int SetUserEnvironment (XrdProofdProtocol *p)
 Set user environment: set effective user and group ID of the process to the ones of the owner of this protocol instnace and change working dir to the sandbox. More...
 
XrdProofdPipePipe ()
 
int DeleteFromSessions (const char *pid)
 Delete from the hash list the session with ID pid. More...
 
int MvSession (const char *fpid)
 Move session file from the active to the terminated areas. More...
 
int CheckActiveSessions (bool verify=1)
 Go through the active sessions admin path and make sure sessions are alive. More...
 
int CheckTerminatedSessions ()
 Go through the terminated sessions admin path and make sure sessions they are gone. More...
 
int CleanClientSessions (const char *usr, int srvtype)
 Go through the sessions admin path and clean all sessions belonging to 'usr'. More...
 
int CleanupLostProofServ ()
 Cleanup (kill) all 'proofserv' processes which lost control from their creator or controller daemon. More...
 
int RecoverActiveSessions ()
 Accept connections from sessions still alive. More...
 
- Public Member Functions inherited from XrdProofdConfig
 XrdProofdConfig (const char *cfg=0, XrdSysError *edest=0)
 Main constructor. More...
 
virtual ~XrdProofdConfig ()
 
void SetCfgEDest (const char *cfg, XrdSysError *edest)
 Set config file and error handler. More...
 
const char * CfgFile () const
 

Static Public Member Functions

static int SetProofServEnv (XrdProofdManager *m, XrdROOT *r)
 Set basic environment accordingly to 'r'. More...
 

Private Member Functions

int DoDirectiveProofServMgr (char *, XrdOucStream *, bool)
 Process 'proofswrvmgr' directive eg: xpd.proofswrvmgr checkfq:120 termto:100 verifyto:5 recoverto:20. More...
 
int DoDirectivePutEnv (char *, XrdOucStream *, bool)
 Process 'putenv' directives. More...
 
int DoDirectivePutRc (char *, XrdOucStream *, bool)
 Process 'putrc' directives. More...
 
int DoDirectiveShutdown (char *, XrdOucStream *, bool)
 Process 'shutdown' directive. More...
 
void ExtractEnv (char *, XrdOucStream *, XrdOucString &users, XrdOucString &groups, XrdOucString &rcval, XrdOucString &rcnam, int &smi, int &smx, int &vmi, int &vmx, bool &hex)
 Extract env information from the stream 'cfg'. More...
 
void FillEnvList (std::list< XpdEnv > *el, const char *nam, const char *val, const char *usrs=0, const char *grps=0, int smi=-1, int smx=-1, int vmi=-1, int vmx=-1, bool hex=0)
 Fill env entry(ies) in the relevant list. More...
 
unsigned int GetSeqSessionN ()
 
int CreateAdminPath (XrdProofdProofServ *xps, XrdProofdProtocol *p, int pid, XrdOucString &emsg)
 Create the admin path for the starting session Return 0 on success, -1 on error (error message in 'emsg') More...
 
int CreateSockPath (XrdProofdProofServ *xps, XrdProofdProtocol *p, unsigned int seq, XrdOucString &emsg)
 Create the socket path for the starting session Return 0 on success, -1 on error (error message in 'emsg') More...
 
int CreateProofServEnvFile (XrdProofdProtocol *p, void *input, const char *envfn, const char *rcfn)
 Create in 'rcfn' the rootrc file for the proofserv being created return 0 on success, -1 on error. More...
 
int CreateProofServRootRc (XrdProofdProtocol *p, void *input, const char *rcfn)
 Create in 'rcfn' the rootrc file for the proofserv being created return 0 on success, -1 on error. More...
 
int SetupProtocol (XrdNetPeer &peerpsrv, XrdProofdProofServ *xps, XrdOucString &e)
 Setup the protocol object serving the peer described by 'peerpsrv'. More...
 
void ParseCreateBuffer (XrdProofdProtocol *p, XrdProofdProofServ *xps, XrdOucString &tag, XrdOucString &ord, XrdOucString &cffile, XrdOucString &uenvs, int &intwait)
 Extract relevant quantities from the buffer received during a create request. More...
 
XrdProofdProofServPrepareProofServ (XrdProofdProtocol *p, XrdProofdResponse *r, unsigned short &sid)
 Allocate and prepare the XrdProofdProofServ object describing this session. More...
 
int PrepareSessionRecovering ()
 Go through the active sessions admin path and prepare reconnection of those still alive. More...
 
int ResolveSession (const char *fpid)
 Handle a request to recover a session after stop&restart. More...
 
void SendErrLog (const char *errlog, XrdProofdResponse *r)
 Send content of errlog upstream asynchronously. More...
 
int AddSession (XrdProofdProtocol *p, XrdProofdProofServ *s)
 Add new active session. More...
 
bool IsSessionSocket (const char *fpid)
 Checks is fpid is the path of a session UNIX socket Returns TRUE is yes; cleans the socket if the session is gone. More...
 
int RmSession (const char *fpid)
 Remove session file from the terminated sessions area. More...
 
int TouchSession (const char *fpid, const char *path=0)
 Update the access time for the session pid file to the current time. More...
 
int VerifySession (const char *fpid, int to=-1, const char *path=0)
 Check if the session is alive, i.e. More...
 
void ResolveKeywords (XrdOucString &s, ProofServEnv_t *in)
 Resolve some keywords in 's' <logfileroot>, <user>, <rootsys> More...
 
int SetUserOwnerships (XrdProofdProtocol *p, const char *ord, const char *stag)
 Set user ownerships on some critical files or directories. More...
 

Private Attributes

XrdProofdManagerfMgr
 
XrdSysRecMutex fMutex
 
XrdSysRecMutex fRecoverMutex
 
XrdSysRecMutex fEnvsMutex
 
XrdSysSemWait fForkSem
 
XrdSysSemWait fProcessSem
 
XrdSysLoggerfLogger
 
int fInternalWait
 
XrdOucString fProofPlugin
 
std::list< XpdEnvfProofServEnvs
 
std::list< XpdEnvfProofServRCs
 
int fShutdownOpt
 
int fShutdownDelay
 
XrdProofdPipe fPipe
 
int fCheckFrequency
 
int fTerminationTimeOut
 
int fVerifyTimeOut
 
int fReconnectTime
 
int fReconnectTimeOut
 
int fRecoverTimeOut
 
int fRecoverDeadline
 
bool fCheckLost
 
bool fUseFork
 
XrdOucString fParentExecs
 
int fCounters [PSMMAXCNTS]
 
int fCurrentSessions
 
unsigned int fSeqSessionN
 
int fNextSessionsCheck
 
XrdOucString fActiAdminPath
 
XrdOucString fTermAdminPath
 
XrdOucHash< XrdProofdProofServfSessions
 
std::list< XrdProofdProofServ * > fActiveSessions
 
std::list< XpdClientSessions * > * fRecoverClients
 
XrdSecCredsSaver_t fCredsSaver
 
std::map< XrdProofdProtocol *, int > fDestroyTimes
 

Additional Inherited Members

- Protected Member Functions inherited from XrdProofdConfig
int ParseFile (bool rcf=false)
 Parse config file for the registered directives. More...
 
bool ReadFile (bool update=true)
 Return true if the file has never been read or did change since last reading, false otherwise. More...
 
void Register (const char *dname, XrdProofdDirective *d)
 
- Protected Attributes inherited from XrdProofdConfig
XrdSysErrorfEDest
 

#include <XrdProofdProofServMgr.h>

+ Inheritance diagram for XrdProofdProofServMgr:
+ Collaboration diagram for XrdProofdProofServMgr:

Member Enumeration Documentation

Enumerator
kCreateCnt 
kCleanSessionsCnt 
kProcessCnt 

Definition at line 232 of file XrdProofdProofServMgr.h.

Enumerator
kSessionRemoval 
kClientDisconnect 
kCleanSessions 
kProcessReq 
kChgSessionSt 

Definition at line 231 of file XrdProofdProofServMgr.h.

Constructor & Destructor Documentation

XrdProofdProofServMgr::XrdProofdProofServMgr ( XrdProofdManager mgr,
XrdProtocol_Config *  pi,
XrdSysError e 
)

Constructor.

Definition at line 268 of file XrdProofdProofServMgr.cxx.

virtual XrdProofdProofServMgr::~XrdProofdProofServMgr ( )
inlinevirtual

Definition at line 229 of file XrdProofdProofServMgr.h.

Member Function Documentation

int XrdProofdProofServMgr::AcceptPeer ( XrdProofdProofServ xps,
int  to,
XrdOucString &  msg 
)

Accept a callback from a starting-up server and setup the related protocol object.

Used for old servers. Return 0 if successful or -1 in case of failure.

Definition at line 2545 of file XrdProofdProofServMgr.cxx.

Referenced by Create(), and Recover().

std::list<XrdProofdProofServ *>* XrdProofdProofServMgr::ActiveSessions ( )
inline

Definition at line 278 of file XrdProofdProofServMgr.h.

Referenced by XrdProofSched::GetNumWorkers().

int XrdProofdProofServMgr::AddSession ( XrdProofdProtocol p,
XrdProofdProofServ s 
)
private

Add new active session.

Definition at line 429 of file XrdProofdProofServMgr.cxx.

Referenced by Create().

bool XrdProofdProofServMgr::Alive ( XrdProofdProtocol p)

Check destroyed status.

Definition at line 4625 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProtocol::Recycle().

int XrdProofdProofServMgr::Attach ( XrdProofdProtocol p)

Handle a request to attach to an existing session.

Definition at line 1555 of file XrdProofdProofServMgr.cxx.

Referenced by Process().

void XrdProofdProofServMgr::BroadcastClusterInfo ( )

Broadcast cluster info to the active sessions.

Definition at line 4543 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProofServCron().

int XrdProofdProofServMgr::BroadcastPriorities ( )

Broadcast priorities to the active sessions.

Returns the number of sessions contacted.

Definition at line 4576 of file XrdProofdProofServMgr.cxx.

int XrdProofdProofServMgr::CheckActiveSessions ( bool  verify = 1)

Go through the active sessions admin path and make sure sessions are alive.

If 'verify' is true also ask the session to proof that they are alive via asynchronous ping (the result will be done at next check). Move those not responding in the terminated sessions admin path.

Definition at line 895 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProtocol::Recycle(), and XrdProofdProofServCron().

int XrdProofdProofServMgr::CheckCounter ( int  t)
inline
int XrdProofdProofServMgr::CheckFrequency ( ) const
inline

Definition at line 241 of file XrdProofdProofServMgr.h.

Referenced by XrdProofdProtocol::Ping(), and XrdProofdProofServCron().

int XrdProofdProofServMgr::CheckTerminatedSessions ( )

Go through the terminated sessions admin path and make sure sessions they are gone.

Hard-kill those still alive.

Definition at line 977 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProofServCron().

int XrdProofdProofServMgr::CleanClientSessions ( const char *  usr,
int  srvtype 
)

Go through the sessions admin path and clean all sessions belonging to 'usr'.

Move those not responding in the terminated sessions admin path.

Definition at line 1036 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProofServCron().

int XrdProofdProofServMgr::CleanupLostProofServ ( )

Cleanup (kill) all 'proofserv' processes which lost control from their creator or controller daemon.

We rely here on the information in the admin path(s) (<xrd_admin>/.xproof.<port>). This is called regurarly by the cron job to avoid having proofservs around. Return number of process killed or -1 in case of any error.

Definition at line 3916 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProofServCron().

int XrdProofdProofServMgr::CleanupProofServ ( bool  all = 0,
const char *  usr = 0 
)

Cleanup (kill) all 'proofserv' processes from the process table.

Only the processes associated with 'usr' are killed, unless 'all' is TRUE, in which case all 'proofserv' instances are terminated (this requires superuser privileges). Super users can also terminated all processes fo another user (specified via usr). Return number of process notified for termination on success, -1 otherwise

Definition at line 4026 of file XrdProofdProofServMgr.cxx.

int XrdProofdProofServMgr::Config ( bool  rcf = 0)
virtual

Run configuration and parse the entered config directives.

Return 0 on success, -1 on error

Reimplemented from XrdProofdConfig.

Definition at line 320 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdManager::Config(), and XrdProofdManagerCron().

int XrdProofdProofServMgr::Create ( XrdProofdProtocol p)

Handle a request to create a new session.

Definition at line 1775 of file XrdProofdProofServMgr.cxx.

Referenced by Process().

int XrdProofdProofServMgr::CreateAdminPath ( XrdProofdProofServ xps,
XrdProofdProtocol p,
int  pid,
XrdOucString &  emsg 
)
private

Create the admin path for the starting session Return 0 on success, -1 on error (error message in 'emsg')

Definition at line 2302 of file XrdProofdProofServMgr.cxx.

int XrdProofdProofServMgr::CreateProofServEnvFile ( XrdProofdProtocol p,
void input,
const char *  envfn,
const char *  rcfn 
)
private

Create in 'rcfn' the rootrc file for the proofserv being created return 0 on success, -1 on error.

Definition at line 3415 of file XrdProofdProofServMgr.cxx.

Referenced by SetProofServEnv().

int XrdProofdProofServMgr::CreateProofServRootRc ( XrdProofdProtocol p,
void input,
const char *  rcfn 
)
private

Create in 'rcfn' the rootrc file for the proofserv being created return 0 on success, -1 on error.

Definition at line 3646 of file XrdProofdProofServMgr.cxx.

Referenced by SetProofServEnv().

int XrdProofdProofServMgr::CreateSockPath ( XrdProofdProofServ xps,
XrdProofdProtocol p,
unsigned int  seq,
XrdOucString &  emsg 
)
private

Create the socket path for the starting session Return 0 on success, -1 on error (error message in 'emsg')

Definition at line 2323 of file XrdProofdProofServMgr.cxx.

int XrdProofdProofServMgr::CurrentSessions ( bool  recalculate = 0)

Return the number of current sessions (top masters)

Definition at line 4702 of file XrdProofdProofServMgr.cxx.

Referenced by Create(), and XrdProofdProofServCron().

int XrdProofdProofServMgr::DeleteFromSessions ( const char *  fpid)

Delete from the hash list the session with ID pid.

Return -ENOENT if not found, or 0.

Definition at line 667 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProtocol::Recycle(), and XrdProofdProofServCron().

int XrdProofdProofServMgr::Destroy ( XrdProofdProtocol p)

Handle a request to shutdown an existing session.

Definition at line 2796 of file XrdProofdProofServMgr.cxx.

Referenced by Process().

int XrdProofdProofServMgr::Detach ( XrdProofdProtocol p)

Handle a request to detach from an existing session.

Definition at line 2767 of file XrdProofdProofServMgr.cxx.

Referenced by Process().

void XrdProofdProofServMgr::DisconnectFromProofServ ( int  pid)

Change reconnecting status.

Definition at line 4669 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProtocol::Recycle().

int XrdProofdProofServMgr::DoDirective ( XrdProofdDirective d,
char *  val,
XrdOucStream *  cfg,
bool  rcf 
)
virtual

Update the priorities of the active sessions.

Reimplemented from XrdProofdConfig.

Definition at line 1188 of file XrdProofdProofServMgr.cxx.

int XrdProofdProofServMgr::DoDirectiveProofServMgr ( char *  val,
XrdOucStream *  cfg,
bool  rcf 
)
private

Process 'proofswrvmgr' directive eg: xpd.proofswrvmgr checkfq:120 termto:100 verifyto:5 recoverto:20.

Definition at line 1214 of file XrdProofdProofServMgr.cxx.

Referenced by DoDirective().

int XrdProofdProofServMgr::DoDirectivePutEnv ( char *  val,
XrdOucStream *  cfg,
bool   
)
private

Process 'putenv' directives.

Definition at line 1283 of file XrdProofdProofServMgr.cxx.

Referenced by DoDirective().

int XrdProofdProofServMgr::DoDirectivePutRc ( char *  val,
XrdOucStream *  cfg,
bool   
)
private

Process 'putrc' directives.

Syntax: xpd.putrc [u:<usr1>,<usr2>,...] [g:<grp1>,<grp2>,...] [s:[svnmin][-][svnmax]] [v:[vermin][-][vermax]] RcVarName RcVarValue NB: <usr1>,... and <grp1>,... may contain the wild card '*'

Definition at line 1314 of file XrdProofdProofServMgr.cxx.

Referenced by DoDirective().

int XrdProofdProofServMgr::DoDirectiveShutdown ( char *  val,
XrdOucStream *  cfg,
bool   
)
private

Process 'shutdown' directive.

Definition at line 1450 of file XrdProofdProofServMgr.cxx.

Referenced by DoDirective().

void XrdProofdProofServMgr::ExtractEnv ( char *  val,
XrdOucStream *  cfg,
XrdOucString &  users,
XrdOucString &  groups,
XrdOucString &  rcval,
XrdOucString &  rcnam,
int &  smi,
int &  smx,
int &  vmi,
int &  vmx,
bool &  hex 
)
private

Extract env information from the stream 'cfg'.

Definition at line 1336 of file XrdProofdProofServMgr.cxx.

Referenced by DoDirectivePutEnv(), and DoDirectivePutRc().

void XrdProofdProofServMgr::FillEnvList ( std::list< XpdEnv > *  el,
const char *  nam,
const char *  val,
const char *  usrs = 0,
const char *  grps = 0,
int  smi = -1,
int  smx = -1,
int  vmi = -1,
int  vmx = -1,
bool  hex = 0 
)
private

Fill env entry(ies) in the relevant list.

Definition at line 1392 of file XrdProofdProofServMgr.cxx.

Referenced by DoDirectivePutEnv(), and DoDirectivePutRc().

void XrdProofdProofServMgr::FormFileNameInSessionDir ( XrdProofdProtocol p,
XrdProofdProofServ xps,
const char *  sessiondir,
const char *  extension,
XrdOucString &  outfn 
)

Definition at line 3194 of file XrdProofdProofServMgr.cxx.

Referenced by Create(), and SetProofServEnv().

XrdProofdProofServ * XrdProofdProofServMgr::GetActiveSession ( int  pid)

Return active session with process ID pid, if any.

Definition at line 4498 of file XrdProofdProofServMgr.cxx.

Referenced by CleanupProofServ().

unsigned int XrdProofdProofServMgr::GetSeqSessionN ( )
inlineprivate

Definition at line 189 of file XrdProofdProofServMgr.h.

void XrdProofdProofServMgr::GetTagDirs ( int  opt,
XrdProofdProtocol p,
XrdProofdProofServ xps,
XrdOucString &  sesstag,
XrdOucString &  topsesstag,
XrdOucString &  sessiondir,
XrdOucString &  sesswrkdir 
)

Determine the unique tag and relevant dirs for this session.

Definition at line 3226 of file XrdProofdProofServMgr.cxx.

Referenced by Create().

int XrdProofdProofServMgr::InternalWait ( ) const
inline

Definition at line 242 of file XrdProofdProofServMgr.h.

bool XrdProofdProofServMgr::IsClientRecovering ( const char *  usr,
const char *  grp,
int &  deadline 
)

Returns true (an the recovering deadline) if the client has sessions in recovering state; returns false otherwise.

Called during for attach requests.

Definition at line 858 of file XrdProofdProofServMgr.cxx.

Referenced by Attach().

bool XrdProofdProofServMgr::IsReconnecting ( )

Return true if in reconnection state, i.e.

during that period during which clients are expected to reconnect. Return false if the session is fully effective

Definition at line 4594 of file XrdProofdProofServMgr.cxx.

Referenced by CheckActiveSessions().

bool XrdProofdProofServMgr::IsSessionSocket ( const char *  fpid)
private

Checks is fpid is the path of a session UNIX socket Returns TRUE is yes; cleans the socket if the session is gone.

Definition at line 457 of file XrdProofdProofServMgr.cxx.

Referenced by CheckActiveSessions().

XrdSysRecMutex* XrdProofdProofServMgr::Mutex ( )
inline

Definition at line 234 of file XrdProofdProofServMgr.h.

Referenced by XrdProofdProtocol::Recycle(), and XrdProofdProofServCron().

int XrdProofdProofServMgr::MvSession ( const char *  fpid)

Move session file from the active to the terminated areas.

Definition at line 496 of file XrdProofdProofServMgr.cxx.

Referenced by CheckActiveSessions(), CleanClientSessions(), PrepareSessionRecovering(), XrdProofdProtocol::Recycle(), and XrdProofdProofServCron().

int XrdProofdProofServMgr::NextSessionsCheck ( )
inline

Definition at line 245 of file XrdProofdProofServMgr.h.

Referenced by XrdProofdProofServCron().

void XrdProofdProofServMgr::ParseCreateBuffer ( XrdProofdProtocol p,
XrdProofdProofServ xps,
XrdOucString &  tag,
XrdOucString &  ord,
XrdOucString &  cffile,
XrdOucString &  uenvs,
int &  intwait 
)
private

Extract relevant quantities from the buffer received during a create request.

Definition at line 1689 of file XrdProofdProofServMgr.cxx.

Referenced by Create().

XrdProofdPipe* XrdProofdProofServMgr::Pipe ( )
inline
XrdProofdProofServ * XrdProofdProofServMgr::PrepareProofServ ( XrdProofdProtocol p,
XrdProofdResponse r,
unsigned short &  sid 
)
private

Allocate and prepare the XrdProofdProofServ object describing this session.

Definition at line 1648 of file XrdProofdProofServMgr.cxx.

Referenced by Create().

int XrdProofdProofServMgr::PrepareSessionRecovering ( )
private

Go through the active sessions admin path and prepare reconnection of those still alive.

Called at start-up.

Definition at line 707 of file XrdProofdProofServMgr.cxx.

Referenced by Config().

int XrdProofdProofServMgr::Process ( XrdProofdProtocol p)

Process manager request.

Definition at line 1502 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdManager::Process().

XrdSysSemWait* XrdProofdProofServMgr::ProcessSem ( )
inline

Definition at line 257 of file XrdProofdProofServMgr.h.

Referenced by XrdProofdProofServCron().

int XrdProofdProofServMgr::Recover ( XpdClientSessions cl)

Handle a request to recover a session after stop&restart for a specific client.

Definition at line 2486 of file XrdProofdProofServMgr.cxx.

Referenced by RecoverActiveSessions().

int XrdProofdProofServMgr::RecoverActiveSessions ( )

Accept connections from sessions still alive.

This is run in a dedicated thread. Returns -1 in case of failure, 0 if all alive sessions reconnected or the numer of sessions not reconnected if the timeout (fRecoverTimeOut per client) expired.

Definition at line 778 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProofServRecover().

void XrdProofdProofServMgr::RegisterDirectives ( )
virtual

Register directives for configuration.

Reimplemented from XrdProofdConfig.

Definition at line 1166 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdProofServMgr().

void XrdProofdProofServMgr::ResolveKeywords ( XrdOucString &  s,
ProofServEnv_t in 
)
private

Resolve some keywords in 's' <logfileroot>, <user>, <rootsys>

Definition at line 4722 of file XrdProofdProofServMgr.cxx.

Referenced by CreateProofServEnvFile(), and SetProofServEnvOld().

int XrdProofdProofServMgr::ResolveSession ( const char *  fpid)
private

Handle a request to recover a session after stop&restart.

Definition at line 2408 of file XrdProofdProofServMgr.cxx.

Referenced by PrepareSessionRecovering().

int XrdProofdProofServMgr::RmSession ( const char *  fpid)
private

Remove session file from the terminated sessions area.

Definition at line 549 of file XrdProofdProofServMgr.cxx.

Referenced by CheckTerminatedSessions(), and CleanClientSessions().

void XrdProofdProofServMgr::SendErrLog ( const char *  errlog,
XrdProofdResponse r 
)
private

Send content of errlog upstream asynchronously.

Definition at line 2358 of file XrdProofdProofServMgr.cxx.

void XrdProofdProofServMgr::SetNextSessionsCheck ( int  t)
inline

Definition at line 247 of file XrdProofdProofServMgr.h.

Referenced by XrdProofdProofServCron().

int XrdProofdProofServMgr::SetProofServEnv ( XrdProofdProtocol p,
void in 
)

Set environment for proofserv.

Definition at line 3330 of file XrdProofdProofServMgr.cxx.

Referenced by Create(), SetProofServEnvOld(), and XrdROOTMgr::Validate().

int XrdProofdProofServMgr::SetProofServEnv ( XrdProofdManager m,
XrdROOT r 
)
static

Set basic environment accordingly to 'r'.

Definition at line 3134 of file XrdProofdProofServMgr.cxx.

int XrdProofdProofServMgr::SetProofServEnvOld ( XrdProofdProtocol p,
void input 
)

Set environment for proofserv; old version preparing the environment for proofserv protocol version <= 13.

Needed for backward compatibility.

Definition at line 2875 of file XrdProofdProofServMgr.cxx.

Referenced by SetProofServEnv().

void XrdProofdProofServMgr::SetReconnectTime ( bool  on = 1)

Change reconnecting status.

Definition at line 4610 of file XrdProofdProofServMgr.cxx.

Referenced by PrepareSessionRecovering(), RecoverActiveSessions(), and XrdProofdProtocol::Recycle().

int XrdProofdProofServMgr::SetupProtocol ( XrdNetPeer &  peerpsrv,
XrdProofdProofServ xps,
XrdOucString &  e 
)
private

Setup the protocol object serving the peer described by 'peerpsrv'.

Definition at line 2579 of file XrdProofdProofServMgr.cxx.

Referenced by AcceptPeer().

int XrdProofdProofServMgr::SetUserEnvironment ( XrdProofdProtocol p)

Set user environment: set effective user and group ID of the process to the ones of the owner of this protocol instnace and change working dir to the sandbox.

Return 0 on success, -1 if enything goes wrong.

Definition at line 4438 of file XrdProofdProofServMgr.cxx.

Referenced by XrdProofdAdmin::CpFile(), Create(), XrdProofdAdmin::ExecCmd(), XrdProofdAdmin::GetFile(), and XrdProofdAdmin::PutFile().

int XrdProofdProofServMgr::SetUserOwnerships ( XrdProofdProtocol p,
const char *  ord,
const char *  stag 
)
private

Set user ownerships on some critical files or directories.

Return 0 on success, -1 if enything goes wrong.

Definition at line 4341 of file XrdProofdProofServMgr.cxx.

Referenced by Create().

int XrdProofdProofServMgr::TouchSession ( const char *  fpid,
const char *  path = 0 
)
private

Update the access time for the session pid file to the current time.

Definition at line 577 of file XrdProofdProofServMgr.cxx.

Referenced by MvSession().

void XrdProofdProofServMgr::UpdateCounter ( int  t,
int  n 
)
inline
int XrdProofdProofServMgr::VerifySession ( const char *  fpid,
int  to = -1,
const char *  fpath = 0 
)
private

Check if the session is alive, i.e.

if it has recently touched its admin file. Return 0 if alive, 1 if not-responding, -1 in case of error. The timeout for verification is 'to' if positive, else fVerifyTimeOut; the admin file is looked under 'fpath' if defined, else fActiAdminPath.

Definition at line 609 of file XrdProofdProofServMgr.cxx.

Referenced by CheckActiveSessions().

int XrdProofdProofServMgr::VerifyTimeOut ( ) const
inline

Definition at line 243 of file XrdProofdProofServMgr.h.

Member Data Documentation

XrdOucString XrdProofdProofServMgr::fActiAdminPath
private
std::list<XrdProofdProofServ *> XrdProofdProofServMgr::fActiveSessions
private
int XrdProofdProofServMgr::fCheckFrequency
private
bool XrdProofdProofServMgr::fCheckLost
private
int XrdProofdProofServMgr::fCounters[PSMMAXCNTS]
private

Definition at line 160 of file XrdProofdProofServMgr.h.

Referenced by XrdProofdProofServMgr().

XrdSecCredsSaver_t XrdProofdProofServMgr::fCredsSaver
private
int XrdProofdProofServMgr::fCurrentSessions
private
std::map<XrdProofdProtocol*,int> XrdProofdProofServMgr::fDestroyTimes
private

Definition at line 176 of file XrdProofdProofServMgr.h.

Referenced by Alive(), and Destroy().

XrdSysRecMutex XrdProofdProofServMgr::fEnvsMutex
private
XrdSysSemWait XrdProofdProofServMgr::fForkSem
private

Definition at line 136 of file XrdProofdProofServMgr.h.

Referenced by Create().

int XrdProofdProofServMgr::fInternalWait
private
XrdSysLogger* XrdProofdProofServMgr::fLogger
private

Definition at line 138 of file XrdProofdProofServMgr.h.

Referenced by Create(), and XrdProofdProofServMgr().

XrdProofdManager* XrdProofdProofServMgr::fMgr
private
XrdSysRecMutex XrdProofdProofServMgr::fMutex
private
int XrdProofdProofServMgr::fNextSessionsCheck
private

Definition at line 165 of file XrdProofdProofServMgr.h.

Referenced by NextSessionsCheck(), and XrdProofdProofServMgr().

XrdOucString XrdProofdProofServMgr::fParentExecs
private
XrdProofdPipe XrdProofdProofServMgr::fPipe
private

Definition at line 147 of file XrdProofdProofServMgr.h.

Referenced by Pipe(), and XrdProofdProofServMgr().

XrdSysSemWait XrdProofdProofServMgr::fProcessSem
private

Definition at line 137 of file XrdProofdProofServMgr.h.

Referenced by Process(), and ProcessSem().

XrdOucString XrdProofdProofServMgr::fProofPlugin
private

Definition at line 140 of file XrdProofdProofServMgr.h.

Referenced by CreateProofServRootRc(), and RegisterDirectives().

std::list<XpdEnv> XrdProofdProofServMgr::fProofServEnvs
private
std::list<XpdEnv> XrdProofdProofServMgr::fProofServRCs
private

Definition at line 142 of file XrdProofdProofServMgr.h.

Referenced by Config(), CreateProofServRootRc(), and DoDirectivePutRc().

int XrdProofdProofServMgr::fReconnectTime
private
int XrdProofdProofServMgr::fReconnectTimeOut
private
std::list<XpdClientSessions *>* XrdProofdProofServMgr::fRecoverClients
private
int XrdProofdProofServMgr::fRecoverDeadline
private
XrdSysRecMutex XrdProofdProofServMgr::fRecoverMutex
private
int XrdProofdProofServMgr::fRecoverTimeOut
private
unsigned int XrdProofdProofServMgr::fSeqSessionN
private

Definition at line 163 of file XrdProofdProofServMgr.h.

Referenced by GetSeqSessionN(), and XrdProofdProofServMgr().

XrdOucHash<XrdProofdProofServ> XrdProofdProofServMgr::fSessions
private
int XrdProofdProofServMgr::fShutdownDelay
private
int XrdProofdProofServMgr::fShutdownOpt
private
XrdOucString XrdProofdProofServMgr::fTermAdminPath
private
int XrdProofdProofServMgr::fTerminationTimeOut
private
bool XrdProofdProofServMgr::fUseFork
private

Definition at line 157 of file XrdProofdProofServMgr.h.

Referenced by Config(), DoDirectiveProofServMgr(), and XrdProofdProofServMgr().

int XrdProofdProofServMgr::fVerifyTimeOut
private

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