Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
XrdProofdSandbox Class Reference

Definition at line 30 of file XrdProofdSandbox.h.

Public Member Functions

 XrdProofdSandbox (XrdProofUI ui, bool full, bool changeown)
 Assert existence on the sandbox for the user defined by 'ui'.
 
int AddSession (const char *tag)
 Record entry for new proofserv session tagged 'tag' in the active sessions file (<SandBox>/.sessions).
 
const char * Dir () const
 
const char * ErrMsg () const
 
int GetSessionDirs (int opt, std::list< XrdOucString * > *sdirs, XrdOucString *tag=0)
 Scan the sandbox for sessions working dirs and return their sorted (according to creation time, first is the newest) list in 'sdirs'.
 
int GuessTag (XrdOucString &tag, int ridx=1)
 Guess session tag completing 'tag' (typically "-<pid>") by scanning the active session file or the session dir.
 
bool IsValid () const
 
int RemoveSession (const char *tag)
 Move record for tag from the active sessions file to the old sessions file (<SandBox>/.sessions).
 
int TrimSessionDirs ()
 If the static fgMaxOldLogs > 0, logs for a fgMaxOldLogs number of sessions are kept in the sandbox; working dirs for sessions in excess are removed.
 

Static Public Member Functions

static void SetMaxOldSessions (int mxses)
 
static void SetWorkdir (const char *wdir)
 

Private Attributes

bool fChangeOwn
 
XrdOucString fDir
 
XrdOucString fErrMsg
 
XrdProofUI fUI
 
bool fValid
 

Static Private Attributes

static int fgMaxOldSessions = 10
 
static XrdProofUI fgUI
 
static XrdOucString fgWorkdir = ""
 

#include <XrdProofdSandbox.h>

Constructor & Destructor Documentation

◆ XrdProofdSandbox()

XrdProofdSandbox::XrdProofdSandbox ( XrdProofUI  ui,
bool  full,
bool  changeown 
)

Assert existence on the sandbox for the user defined by 'ui'.

The sandbox is created under fgWorkdir or $HOME/proof; the boolean 'full' controls the set of directories to be asserted: the sub-set {cache, packages, .creds} is always asserted; if full is true also the sub-dirs {queries, datasets} are asserted. If 'changeown' is true the sandbox ownership is set to 'ui'; this requires su-privileges. The constructor also builds the list of sessions directories in the sandbox; directories corresponding to terminated sessions are removed if the total number of session directories is larger than fgMaxOldSessions .

Definition at line 47 of file XrdProofdSandbox.cxx.

Member Function Documentation

◆ AddSession()

int XrdProofdSandbox::AddSession ( const char *  tag)

Record entry for new proofserv session tagged 'tag' in the active sessions file (<SandBox>/.sessions).

The file is created if needed. Return 0 on success, -1 on error.

Definition at line 324 of file XrdProofdSandbox.cxx.

◆ Dir()

const char * XrdProofdSandbox::Dir ( ) const
inline

Definition at line 48 of file XrdProofdSandbox.h.

◆ ErrMsg()

const char * XrdProofdSandbox::ErrMsg ( ) const
inline

Definition at line 52 of file XrdProofdSandbox.h.

◆ GetSessionDirs()

int XrdProofdSandbox::GetSessionDirs ( int  opt,
std::list< XrdOucString * > *  sdirs,
XrdOucString *  tag = 0 
)

Scan the sandbox for sessions working dirs and return their sorted (according to creation time, first is the newest) list in 'sdirs'.

The option 'opt' may have 3 values: 0 all working dirs are kept 1 active sessions only 2 terminated sessions only 3 search entry containing 'tag' and fill tag with the full entry name; if defined, sdirs is filled Returns -1 otherwise in case of failure. In case of success returns 0 for opt < 3, 1 if found or 0 if not found for opt == 3.

Definition at line 252 of file XrdProofdSandbox.cxx.

◆ GuessTag()

int XrdProofdSandbox::GuessTag ( XrdOucString &  tag,
int  ridx = 1 
)

Guess session tag completing 'tag' (typically "-<pid>") by scanning the active session file or the session dir.

In case of success, tag is filled with the full tag and 0 is returned. In case of failure, -1 is returned.

Definition at line 401 of file XrdProofdSandbox.cxx.

◆ IsValid()

bool XrdProofdSandbox::IsValid ( ) const
inline

Definition at line 53 of file XrdProofdSandbox.h.

◆ RemoveSession()

int XrdProofdSandbox::RemoveSession ( const char *  tag)

Move record for tag from the active sessions file to the old sessions file (<SandBox>/.sessions).

The active file is removed if empty after the operation. The old sessions file is created if needed. Return 0 on success, -1 on error.

Definition at line 508 of file XrdProofdSandbox.cxx.

◆ SetMaxOldSessions()

static void XrdProofdSandbox::SetMaxOldSessions ( int  mxses)
inlinestatic

Definition at line 65 of file XrdProofdSandbox.h.

◆ SetWorkdir()

static void XrdProofdSandbox::SetWorkdir ( const char *  wdir)
inlinestatic

Definition at line 66 of file XrdProofdSandbox.h.

◆ TrimSessionDirs()

int XrdProofdSandbox::TrimSessionDirs ( )

If the static fgMaxOldLogs > 0, logs for a fgMaxOldLogs number of sessions are kept in the sandbox; working dirs for sessions in excess are removed.

By default logs for the last 10 sessions are kept; the limit can be changed via the static method XrdProofdClient::SetMaxOldLogs. Return 0 on success, -1 on error.

Definition at line 617 of file XrdProofdSandbox.cxx.

Member Data Documentation

◆ fChangeOwn

bool XrdProofdSandbox::fChangeOwn
private

Definition at line 34 of file XrdProofdSandbox.h.

◆ fDir

XrdOucString XrdProofdSandbox::fDir
private

Definition at line 35 of file XrdProofdSandbox.h.

◆ fErrMsg

XrdOucString XrdProofdSandbox::fErrMsg
private

Definition at line 36 of file XrdProofdSandbox.h.

◆ fgMaxOldSessions

int XrdProofdSandbox::fgMaxOldSessions = 10
staticprivate

Definition at line 41 of file XrdProofdSandbox.h.

◆ fgUI

XrdProofUI XrdProofdSandbox::fgUI
staticprivate

Definition at line 43 of file XrdProofdSandbox.h.

◆ fgWorkdir

XrdOucString XrdProofdSandbox::fgWorkdir = ""
staticprivate

Definition at line 42 of file XrdProofdSandbox.h.

◆ fUI

XrdProofUI XrdProofdSandbox::fUI
private

Definition at line 38 of file XrdProofdSandbox.h.

◆ fValid

bool XrdProofdSandbox::fValid
private

Definition at line 37 of file XrdProofdSandbox.h.

  • proof/proofd/inc/XrdProofdSandbox.h
  • proof/proofd/src/XrdProofdSandbox.cxx