ROOT
6.06/09
Reference Guide
|
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'. More... | |
const char * | Dir () const |
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... | |
const char * | ErrMsg () const |
bool | IsValid () const |
int | AddSession (const char *tag) |
Record entry for new proofserv session tagged 'tag' in the active sessions file (<SandBox>/.sessions). More... | |
int | RemoveSession (const char *tag) |
Move record for tag from the active sessions file to the old sessions file (<SandBox>/.sessions). More... | |
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 | 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... | |
Static Public Member Functions | |
static void | SetMaxOldSessions (int mxses) |
static void | SetWorkdir (const char *wdir) |
Private Attributes | |
bool | fChangeOwn |
XrdOucString | fDir |
XrdOucString | fErrMsg |
bool | fValid |
XrdProofUI | fUI |
Static Private Attributes | |
static int | fgMaxOldSessions = 10 |
static XrdOucString | fgWorkdir = "" |
static XrdProofUI | fgUI |
#include <XrdProofdSandbox.h>
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.
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.
Referenced by XrdProofdProofServMgr::Create().
|
inline |
Definition at line 48 of file XrdProofdSandbox.h.
Referenced by XrdProofdAdmin::CpFile(), XrdProofdProofServMgr::CreateProofServEnvFile(), XrdProofdProofServMgr::CreateProofServRootRc(), XrdProofdAdmin::Exec(), XrdProofdAdmin::GetFile(), XrdProofdProofServMgr::GetTagDirs(), XrdProofdAdmin::PutFile(), XrdProofdAdmin::QueryLogPaths(), XrdProofdProofServMgr::SetProofServEnv(), XrdProofdProofServMgr::SetProofServEnvOld(), XrdProofdProofServMgr::SetUserEnvironment(), and XrdProofdProofServMgr::SetUserOwnerships().
|
inline |
Definition at line 52 of file XrdProofdSandbox.h.
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.
Referenced by GuessTag(), and TrimSessionDirs().
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.
Referenced by XrdProofdAdmin::QueryLogPaths(), and XrdProofdClient::TerminateSessions().
|
inline |
Definition at line 53 of file XrdProofdSandbox.h.
Referenced by XrdProofdClient::XrdProofdClient().
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.
Referenced by XrdProofdClient::TerminateSessions(), and TrimSessionDirs().
|
inlinestatic |
Definition at line 65 of file XrdProofdSandbox.h.
Referenced by XrdProofdManager::DoDirectiveMaxOldLogs().
|
inlinestatic |
Definition at line 66 of file XrdProofdSandbox.h.
Referenced by XrdProofdManager::Config().
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.
Referenced by XrdProofdClient::TrimSessionDirs(), and XrdProofdSandbox().
|
private |
Definition at line 34 of file XrdProofdSandbox.h.
Referenced by AddSession(), RemoveSession(), and TrimSessionDirs().
|
private |
Definition at line 35 of file XrdProofdSandbox.h.
Referenced by AddSession(), GetSessionDirs(), GuessTag(), RemoveSession(), TrimSessionDirs(), and XrdProofdSandbox().
|
private |
Definition at line 36 of file XrdProofdSandbox.h.
Referenced by XrdProofdSandbox().
|
staticprivate |
Definition at line 41 of file XrdProofdSandbox.h.
Referenced by TrimSessionDirs().
|
staticprivate |
Definition at line 43 of file XrdProofdSandbox.h.
Referenced by XrdProofdSandbox().
|
staticprivate |
Definition at line 42 of file XrdProofdSandbox.h.
Referenced by XrdProofdSandbox().
|
private |
Definition at line 38 of file XrdProofdSandbox.h.
Referenced by AddSession(), RemoveSession(), and TrimSessionDirs().
|
private |
Definition at line 37 of file XrdProofdSandbox.h.
Referenced by IsValid(), and XrdProofdSandbox().