ROOT  6.06/09
Reference Guide
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 
32 private:
33 
34  bool fChangeOwn;
35  XrdOucString fDir;
36  XrdOucString fErrMsg;
37  bool fValid;
39 
40 
41  static int fgMaxOldSessions;
42  static XrdOucString fgWorkdir;
43  static XrdProofUI fgUI;
44 
45 public:
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
const char * Dir() const
int TrimSessionDirs()
If the static fgMaxOldLogs > 0, logs for a fgMaxOldLogs number of sessions are kept in the sandbox; w...
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...
static void SetWorkdir(const char *wdir)
const char * ErrMsg() const
static int fgMaxOldSessions
int changeown(const std::string &path, uid_t u, gid_t g)
Change the ownership of 'path' to the entity described by {u,g}.
Definition: proofexecv.cxx:802
XrdOucString fErrMsg
bool IsValid() const
int GuessTag(XrdOucString &tag, int ridx=1)
Guess session tag completing 'tag' (typically "-") by scanning the active session file or the se...
int AddSession(const char *tag)
Record entry for new proofserv session tagged 'tag' in the active sessions file (/.sessions).
int RemoveSession(const char *tag)
Move record for tag from the active sessions file to the old sessions file (/.sessions).
XrdProofdSandbox(XrdProofUI ui, bool full, bool changeown)
Assert existence on the sandbox for the user defined by 'ui'.
XrdOucString fDir
static XrdProofUI fgUI
static XrdOucString fgWorkdir
static void SetMaxOldSessions(int mxses)