Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
XrdProofdSandbox.h
Go to the documentation of this file.
1// @(#)root/proofd:$Id$
2// Author: G. Ganis Jan 2008
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_XrdProofdSandbox
13#define ROOT_XrdProofdSandbox
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// XrdProofdSandbox //
18// //
19// Authors: G. Ganis, CERN, 2008 //
20// //
21// Create and manage a Unix sandbox. //
22// //
23//////////////////////////////////////////////////////////////////////////
24
25#include <list>
26
27#include "XrdProofdAux.h"
28#include "XrdOuc/XrdOucString.hh"
29
31
32private:
33
35 XrdOucString fDir;
36 XrdOucString fErrMsg;
37 bool fValid;
39
40
41 static int fgMaxOldSessions;
42 static XrdOucString fgWorkdir;
44
45public:
46 XrdProofdSandbox(XrdProofUI ui, bool full, bool changeown);
47
48 const char *Dir() const { return fDir.c_str(); }
49
50 int GuessTag(XrdOucString &tag, int ridx = 1);
51
52 const char *ErrMsg() const { return fErrMsg.c_str(); }
53 bool IsValid() const { return fValid; }
54
55 // Active sessions file management
56 int AddSession(const char *tag);
57 int RemoveSession(const char *tag);
58
59 //Parse the session dirs
60 int GetSessionDirs(int opt, std::list<XrdOucString *> *sdirs,
61 XrdOucString *tag = 0);
62 int TrimSessionDirs();
63
64 // The manager uses these to set configurable members
65 static void SetMaxOldSessions(int mxses) { fgMaxOldSessions = mxses; }
66 static void SetWorkdir(const char *wdir) { fgWorkdir = wdir; }
67};
68#endif
static XrdProofUI fgUI
const char * Dir() const
const char * ErrMsg() const
static XrdOucString fgWorkdir
static int fgMaxOldSessions
int GuessTag(XrdOucString &tag, int ridx=1)
Guess session tag completing 'tag' (typically "-<pid>") by scanning the active session file or the se...
bool IsValid() const
int AddSession(const char *tag)
Record entry for new proofserv session tagged 'tag' in the active sessions file (<SandBox>/....
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,...
XrdOucString fErrMsg
static void SetWorkdir(const char *wdir)
int TrimSessionDirs()
If the static fgMaxOldLogs > 0, logs for a fgMaxOldLogs number of sessions are kept in the sandbox; w...
int RemoveSession(const char *tag)
Move record for tag from the active sessions file to the old sessions file (<SandBox>/....
static void SetMaxOldSessions(int mxses)
int changeown(const std::string &path, uid_t u, gid_t g)
Change the ownership of 'path' to the entity described by {u,g}.