Definition at line 30 of file XrdProofdSandbox.h.
|
| XrdProofdSandbox (XrdProofUI ui, bool full, bool changeown) |
| Assert existence on the sandbox for the user defined by 'ui'. More...
|
|
int | AddSession (const char *tag) |
| Record entry for new proofserv session tagged 'tag' in the active sessions file (<SandBox>/.sessions). More...
|
|
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'. More...
|
|
int | GuessTag (XrdOucString &tag, int ridx=1) |
| Guess session tag completing 'tag' (typically "-<pid>") by scanning the active session file or the session dir. More...
|
|
bool | IsValid () const |
|
int | RemoveSession (const char *tag) |
| Move record for tag from the active sessions file to the old sessions file (<SandBox>/.sessions). More...
|
|
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. More...
|
|
#include <XrdProofdSandbox.h>
◆ 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.
◆ 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 |
◆ ErrMsg()
const char * XrdProofdSandbox::ErrMsg |
( |
| ) |
const |
|
inline |
◆ 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 |
◆ 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 |
◆ SetWorkdir()
static void XrdProofdSandbox::SetWorkdir |
( |
const char * |
wdir | ) |
|
|
inlinestatic |
◆ 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.
◆ fChangeOwn
bool XrdProofdSandbox::fChangeOwn |
|
private |
◆ fDir
XrdOucString XrdProofdSandbox::fDir |
|
private |
◆ fErrMsg
XrdOucString XrdProofdSandbox::fErrMsg |
|
private |
◆ fgMaxOldSessions
int XrdProofdSandbox::fgMaxOldSessions = 10 |
|
staticprivate |
◆ fgUI
◆ fgWorkdir
XrdOucString XrdProofdSandbox::fgWorkdir = "" |
|
staticprivate |
◆ fUI
◆ fValid
bool XrdProofdSandbox::fValid |
|
private |
[legend]