ROOT  6.06/09
Reference Guide
TProofServLite.cxx
Go to the documentation of this file.
1 // @(#)root/proofx:$Id$
2 // Author: Gerardo Ganis 12/12/2005
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 //////////////////////////////////////////////////////////////////////////
13 // //
14 // TProofServLite //
15 // //
16 // TProofServLite is the version of the PROOF worker server for local //
17 // running. The client starts directly the desired number of these //
18 // workers; the master and daemons are eliminated, optimizing the number//
19 // of messages exchanged and created / destroyed. //
20 // //
21 //////////////////////////////////////////////////////////////////////////
22 
23 #include "RConfigure.h"
24 #include "RConfig.h"
25 #include "Riostream.h"
26 
27 #ifdef WIN32
28  #include <io.h>
29  typedef long off_t;
30  #include <snprintf.h>
31 #else
32 #include <netinet/in.h>
33 #endif
34 #include <sys/types.h>
35 #include <cstdlib>
36 
37 #include "TProofServLite.h"
38 #include "TObjString.h"
39 #include "TEnv.h"
40 #include "TError.h"
41 #include "TException.h"
42 #include "THashList.h"
43 #include "TInterpreter.h"
44 #include "TMessage.h"
45 #include "TProofDebug.h"
46 #include "TProof.h"
47 #include "TProofPlayer.h"
48 #include "TProofQueryResult.h"
49 #include "TRegexp.h"
50 #include "TClass.h"
51 #include "TROOT.h"
52 #include "TSystem.h"
53 #include "TPluginManager.h"
54 #include "TSocket.h"
55 #include "TTimeStamp.h"
56 #include "compiledata.h"
57 
58 using namespace std;
59 
60 // debug hook
61 static volatile Int_t gProofServDebug = 1;
62 
63 //----- Interrupt signal handler -----------------------------------------------
64 ////////////////////////////////////////////////////////////////////////////////
65 
66 class TProofServLiteInterruptHandler : public TSignalHandler {
67  TProofServLite *fServ;
68 public:
69  TProofServLiteInterruptHandler(TProofServLite *s)
70  : TSignalHandler(kSigUrgent, kFALSE) { fServ = s; }
71  Bool_t Notify();
72 };
73 
74 ////////////////////////////////////////////////////////////////////////////////
75 /// Handle urgent data
76 
78 {
79  fServ->HandleUrgentData();
80  if (TROOT::Initialized()) {
81  Throw(GetSignal());
82  }
83  return kTRUE;
84 }
85 
86 //----- SigPipe signal handler -------------------------------------------------
87 ////////////////////////////////////////////////////////////////////////////////
88 
89 class TProofServLiteSigPipeHandler : public TSignalHandler {
90  TProofServLite *fServ;
91 public:
92  TProofServLiteSigPipeHandler(TProofServLite *s) : TSignalHandler(kSigPipe, kFALSE)
93  { fServ = s; }
94  Bool_t Notify();
95 };
96 
97 ////////////////////////////////////////////////////////////////////////////////
98 /// Handle sig pipe
99 
101 {
102  fServ->HandleSigPipe();
103  return kTRUE;
104 }
105 
106 //----- Termination signal handler ---------------------------------------------
107 ////////////////////////////////////////////////////////////////////////////////
108 
109 class TProofServLiteTerminationHandler : public TSignalHandler {
110  TProofServLite *fServ;
111 public:
112  TProofServLiteTerminationHandler(TProofServLite *s)
113  : TSignalHandler(kSigTermination, kFALSE) { fServ = s; }
114  Bool_t Notify();
115 };
116 
117 ////////////////////////////////////////////////////////////////////////////////
118 /// Handle termination
119 
121 {
122  Printf("TProofServLiteTerminationHandler::Notify: wake up!");
123 
124  fServ->HandleTermination();
125  return kTRUE;
126 }
127 
128 //----- Seg violation signal handler ---------------------------------------------
129 ////////////////////////////////////////////////////////////////////////////////
130 
131 class TProofServLiteSegViolationHandler : public TSignalHandler {
132  TProofServLite *fServ;
133 public:
134  TProofServLiteSegViolationHandler(TProofServLite *s)
136  Bool_t Notify();
137 };
138 
139 ////////////////////////////////////////////////////////////////////////////////
140 /// Handle seg violation
141 
143 {
144  Printf("**** ");
145  Printf("**** Segmentation violation: terminating ****");
146  Printf("**** ");
147  fServ->HandleTermination();
148  return kTRUE;
149 }
150 
151 //----- Input handler for messages from parent or master -----------------------
152 ////////////////////////////////////////////////////////////////////////////////
153 
154 class TProofServLiteInputHandler : public TFileHandler {
155  TProofServLite *fServ;
156 public:
157  TProofServLiteInputHandler(TProofServLite *s, Int_t fd) : TFileHandler(fd, 1)
158  { fServ = s; }
159  Bool_t Notify();
160  Bool_t ReadNotify() { return Notify(); }
161 };
162 
163 ////////////////////////////////////////////////////////////////////////////////
164 /// Handle input on the socket
165 
167 {
168  fServ->HandleSocketInput();
169 
170  return kTRUE;
171 }
172 
174 
175 // Hook to the constructor. This is needed to avoid using the plugin manager
176 // which may create problems in multi-threaded environments.
177 extern "C" {
178  TApplication *GetTProofServLite(Int_t *argc, char **argv, FILE *flog)
179  { return new TProofServLite(argc, argv, flog); }
180 }
181 
182 ////////////////////////////////////////////////////////////////////////////////
183 /// Main constructor
184 
185 TProofServLite::TProofServLite(Int_t *argc, char **argv, FILE *flog)
186  : TProofServ(argc, argv, flog)
187 {
188  fInterruptHandler = 0;
190 }
191 
192 ////////////////////////////////////////////////////////////////////////////////
193 /// Finalize the server setup. If master, create the TProof instance to talk
194 /// the worker or submaster nodes.
195 /// Return 0 on success, -1 on error
196 
198 {
199  if (gProofDebugLevel > 0)
200  Info("CreateServer", "starting server creation");
201 
202  // Get file descriptor for log file
203  if (fLogFile) {
204  // Use the file already open by pmain
205  if ((fLogFileDes = fileno(fLogFile)) < 0) {
206  Error("CreateServer", "resolving the log file description number");
207  return -1;
208  }
209  }
210 
211  // Get socket to be used to call back our xpd
212  fSockPath = gEnv->GetValue("ProofServ.OpenSock", "");
213  if (fSockPath.Length() <= 0) {
214  Error("CreateServer", "Socket setup by xpd undefined");
215  return -1;
216  }
217  TString entity = gEnv->GetValue("ProofServ.Entity", "");
218  if (entity.Length() > 0)
219  fSockPath.Insert(0,TString::Format("%s/", entity.Data()));
220 
221  // Call back the client
222  fSocket = new TSocket(fSockPath);
223  if (!fSocket || !(fSocket->IsValid())) {
224  Error("CreateServer", "Failed to open connection to the client");
225  return -1;
226  }
227 
228  // Send our ordinal, to allow the client to identify us
229  TMessage msg;
230  msg << fOrdinal;
231  fSocket->Send(msg);
232 
233  // Get socket descriptor
234  Int_t sock = fSocket->GetDescriptor();
235 
236  // Install interrupt and message input handlers
237  fInterruptHandler = new TProofServLiteInterruptHandler(this);
239  gSystem->AddFileHandler(new TProofServLiteInputHandler(this, sock));
240 
241  // Wait (loop) in worker node to allow debugger to connect
242  if (gEnv->GetValue("Proof.GdbHook",0) == 2) {
243  while (gProofServDebug)
244  ;
245  }
246 
247  if (gProofDebugLevel > 0)
248  Info("CreateServer", "Service: %s, ConfDir: %s, IsMaster: %d",
250 
251  if (Setup() == -1) {
252  // Setup failure
253  Terminate(0);
254  SendLogFile();
255  return -1;
256  }
257 
258  if (!fLogFile) {
259  RedirectOutput();
260  // If for some reason we failed setting a redirection file for the logs
261  // we cannot continue
262  if (!fLogFile || (fLogFileDes = fileno(fLogFile)) < 0) {
263  Terminate(0);
264  SendLogFile(-98);
265  return -1;
266  }
267  }
268 
269  // Everybody expects std::iostream to be available, so load it...
270  ProcessLine("#include <iostream>", kTRUE);
271  ProcessLine("#include <string>",kTRUE); // for std::string std::iostream.
272 
273  // Load user functions
274  const char *logon;
275  logon = gEnv->GetValue("Proof.Load", (char *)0);
276  if (logon) {
277  char *mac = gSystem->Which(TROOT::GetMacroPath(), logon, kReadPermission);
278  if (mac)
279  ProcessLine(TString::Format(".L %s", logon), kTRUE);
280  delete [] mac;
281  }
282 
283  // Execute logon macro
284  logon = gEnv->GetValue("Proof.Logon", (char *)0);
285  if (logon && !NoLogOpt()) {
286  char *mac = gSystem->Which(TROOT::GetMacroPath(), logon, kReadPermission);
287  if (mac)
288  ProcessFile(logon);
289  delete [] mac;
290  }
291 
292  // Save current interpreter context
293  gInterpreter->SaveContext();
294  gInterpreter->SaveGlobalsContext();
295 
296  // Avoid spurious messages at first action
297  FlushLogFile();
298 
299  // Done
300  return 0;
301 }
302 
303 ////////////////////////////////////////////////////////////////////////////////
304 /// Cleanup. Not really necessary since after this dtor there is no
305 /// live anyway.
306 
308 {
309  delete fSocket;
310 }
311 
312 ////////////////////////////////////////////////////////////////////////////////
313 /// Called when the client is not alive anymore; terminate the session.
314 
316 {
317  Terminate(0); // will not return from here....
318 }
319 
320 ////////////////////////////////////////////////////////////////////////////////
321 /// Called when the client is not alive anymore; terminate the session.
322 
324 {
325  Terminate(0); // will not return from here....
326 }
327 
328 ////////////////////////////////////////////////////////////////////////////////
329 /// Print the ProofServ logo on standard output.
330 /// Return 0 on success, -1 on error
331 
333 {
334  char str[512];
335 
336  if (IsMaster()) {
337  snprintf(str, 512, "**** Welcome to the PROOF server @ %s ****", gSystem->HostName());
338  } else {
339  snprintf(str, 512, "**** PROOF worker server @ %s started ****", gSystem->HostName());
340  }
341 
342  if (fSocket->Send(str) != 1+static_cast<Int_t>(strlen(str))) {
343  Error("Setup", "failed to send proof server startup message");
344  return -1;
345  }
346 
347  // Get client protocol
348  if ((fProtocol = gEnv->GetValue("ProofServ.ClientVersion", -1)) < 0) {
349  Error("Setup", "remote proof protocol missing");
350  return -1;
351  }
352 
353  // The local user
355  if (pw) {
356  fUser = pw->fUser;
357  delete pw;
358  }
359 
360  // Work dir and ...
361  fWorkDir = gEnv->GetValue("ProofServ.Sandbox", TString::Format("~/%s", kPROOF_WorkDir));
362  Info("Setup", "fWorkDir: %s", fWorkDir.Data());
363 
364  // Get Session tags
365  fTopSessionTag = gEnv->GetValue("ProofServ.SessionTag", "-1");
366  fSessionTag.Form("%s-%s-%ld-%d", fOrdinal.Data(), gSystem->HostName(),
368  if (gProofDebugLevel > 0)
369  Info("Setup", "session tag is %s", fSessionTag.Data());
370  if (fTopSessionTag.IsNull()) fTopSessionTag = fSessionTag;
371 
372  // Send session tag to client
374  m << fSessionTag;
375  fSocket->Send(m);
376 
377  // Get Session dir (sandbox)
378  if ((fSessionDir = gEnv->GetValue("ProofServ.SessionDir", "-1")) == "-1") {
379  Error("Setup", "Session dir missing");
380  return -1;
381  }
382 
383  // Link the session tag to the log file
384  if (gSystem->Getenv("ROOTPROOFLOGFILE")) {
385  TString logfile = gSystem->Getenv("ROOTPROOFLOGFILE");
386  Int_t iord = logfile.Index(TString::Format("-%s", fOrdinal.Data()));
387  if (iord != kNPOS) logfile.Remove(iord);
388  logfile += TString::Format("-%s.log", fSessionTag.Data());
389  gSystem->Symlink(gSystem->Getenv("ROOTPROOFLOGFILE"), logfile);
390  }
391 
392  // Goto to the main PROOF working directory
394  fWorkDir = workdir;
395  delete [] workdir;
396  if (gProofDebugLevel > 0)
397  Info("Setup", "working directory set to %s", fWorkDir.Data());
398 
399  // Common setup
400  if (SetupCommon() != 0) {
401  Error("Setup", "common setup failed");
402  return -1;
403  }
404 
405  // Check every two hours if client is still alive
407 
408  // Install SigPipe handler to handle kKeepAlive failure
409  gSystem->AddSignalHandler(new TProofServLiteSigPipeHandler(this));
410 
411  // Install Termination handler
412  gSystem->AddSignalHandler(new TProofServLiteTerminationHandler(this));
413 
414  // Install seg violation handler
415  gSystem->AddSignalHandler(new TProofServLiteSegViolationHandler(this));
416 
417  // Done
418  return 0;
419 }
420 
421 ////////////////////////////////////////////////////////////////////////////////
422 /// Terminate the proof server.
423 
425 {
426  if (fTerminated)
427  // Avoid doubling the exit operations
428  exit(1);
429  fTerminated = kTRUE;
430 
431  // Notify
432  Info("Terminate", "starting session termination operations ...");
433 
434  // Cleanup session directory
435  if (status == 0) {
436  // make sure we remain in a "connected" directory
437  gSystem->ChangeDirectory("/");
438  // needed in case fSessionDir is on NFS ?!
439  gSystem->MakeDirectory(fSessionDir+"/.delete");
441  }
442 
443  // Cleanup data directory if empty
445  if (UnlinkDataDir(fDataDir))
446  Info("Terminate", "data directory '%s' has been removed", fDataDir.Data());
447  }
448 
449  // Remove input and signal handlers to avoid spurious "signals"
450  // for closing activities executed upon exit()
452 
453  // Stop processing events (set a flag to exit the event loop)
454  gSystem->ExitLoop();
455 
456  // Notify
457  Printf("Terminate: termination operations ended: quitting!");
458 }
459 
460 ////////////////////////////////////////////////////////////////////////////////
461 /// Cloning itself via fork.
462 
464 {
465  if (!mess) {
466  Error("HandleFork", "empty message!");
467  return;
468  }
469 
470  // Extract the ordinals of the clones
471  TString clones;
472  (*mess) >> clones;
473  PDB(kGlobal, 1)
474  Info("HandleFork", "cloning to %s", clones.Data());
475 
476  TString clone;
477  Int_t from = 0;
478  while (clones.Tokenize(clone, from, " ")) {
479 
480  Int_t rc = 0;
481  // Fork
482  if ((rc = Fork()) < 0) {
483  Error("HandleFork", "failed to fork %s", clone.Data());
484  return;
485  }
486 
487  // If the child, finalize the setup and return
488  if (rc == 0) {
489  SetupOnFork(clone.Data());
490  return;
491  }
492  }
493 
494  // Done
495  return;
496 }
497 
498 ////////////////////////////////////////////////////////////////////////////////
499 /// Finalize the server setup afetr forking.
500 /// Return 0 on success, -1 on error
501 
503 {
504  if (gProofDebugLevel > 0)
505  Info("SetupOnFork", "finalizing setup of %s", ord);
506 
507  // Set the ordinal
508  fOrdinal = ord;
509  TString sord;
510  sord.Form("-%s", fOrdinal.Data());
511 
512  // Close the current log file
513  if (fLogFile) {
514  fclose(fLogFile);
515  fLogFileDes = -1;
516  }
517 
519  RedirectOutput(sdir.Data(), "a");
520  // If for some reason we failed setting a redirection file for the logs
521  // we cannot continue
522  if (!fLogFile || (fLogFileDes = fileno(fLogFile)) < 0) {
523  Terminate(0);
524  return -1;
525  }
526  FlushLogFile();
527 
528  // Eliminate existing symlink
529  void *dirp = gSystem->OpenDirectory(sdir);
530  if (dirp) {
531  TString ent;
532  const char *e = 0;
533  while ((e = gSystem->GetDirEntry(dirp))) {
534  ent.Form("%s/%s", sdir.Data(), e);
535  FileStat_t st;
536  if (gSystem->GetPathInfo(ent.Data(), st) == 0) {
537  if (st.fIsLink && ent.Contains(sord)) {
538  PDB(kGlobal, 1)
539  Info("SetupOnFork","unlinking: %s", ent.Data());
540  gSystem->Unlink(ent);
541  }
542  }
543  }
544  gSystem->FreeDirectory(dirp);
545  }
546 
547  // The session tag
548  fSessionTag.Form("%s-%d-%d", gSystem->HostName(), (int)time(0), gSystem->GetPid());
549 
550  // Create new symlink
551  TString logfile = gSystem->Getenv("ROOTPROOFLOGFILE");
552  logfile.ReplaceAll("-0.0", sord.Data());
553  gSystem->Setenv("ROOTPROOFLOGFILE", logfile);
554  Int_t iord = logfile.Index(sord.Data());
555  if (iord != kNPOS) logfile.Remove(iord + sord.Length());
556  logfile += TString::Format("-%s.log", fSessionTag.Data());
557  gSystem->Symlink(gSystem->Getenv("ROOTPROOFLOGFILE"), logfile);
558 
559  // Get socket to be used to call back our xpd
560  fSockPath = gEnv->GetValue("ProofServ.OpenSock", "");
561  if (fSockPath.Length() <= 0) {
562  Error("CreateServer", "Socket setup by xpd undefined");
563  return -1;
564  }
565  TString entity = gEnv->GetValue("ProofServ.Entity", "");
566  if (entity.Length() > 0)
567  fSockPath.Insert(0, TString::Format("%s/", entity.Data()));
568 
569  // Call back the client
570  fSocket = new TSocket(fSockPath);
571  if (!fSocket || !(fSocket->IsValid())) {
572  Error("CreateServer", "Failed to open connection to the client");
573  return -1;
574  }
575 
576  // Send our ordinal, to allow the client to identify us
577  TMessage msg;
578  msg << fOrdinal;
579  fSocket->Send(msg);
580 
581  // Get socket descriptor
582  Int_t sock = fSocket->GetDescriptor();
583 
584  // Install interrupt and message input handlers
585  fInterruptHandler = new TProofServLiteInterruptHandler(this);
587  gSystem->AddFileHandler(new TProofServLiteInputHandler(this, sock));
588 
589  // Wait (loop) in worker node to allow debugger to connect
590  if (gEnv->GetValue("Proof.GdbHook",0) == 2) {
591  while (gProofServDebug)
592  ;
593  }
594 
595  if (gProofDebugLevel > 0)
596  Info("SetupOnFork", "Service: %s, ConfDir: %s, IsMaster: %d",
598 
599  if (Setup() == -1) {
600  // Setup failure
601  Terminate(0);
602  SendLogFile();
603  return -1;
604  }
605 
606  // Disallow the interpretation of Rtypes.h, TError.h and TGenericClassInfo.h
607  ProcessLine("#define ROOT_Rtypes 0", kTRUE);
608  ProcessLine("#define ROOT_TError 0", kTRUE);
609  ProcessLine("#define ROOT_TGenericClassInfo 0", kTRUE);
610 
611  // Save current interpreter context
612  gInterpreter->SaveContext();
613  gInterpreter->SaveGlobalsContext();
614 
615  // Done
616  return 0;
617 }
Bool_t fMasterServ
Definition: TProofServ.h:123
FILE * fLogFile
Definition: TProofServ.h:111
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1265
virtual Long_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=0)
Process a single command line, either a C++ statement or an interpreter command starting with a "...
virtual int GetPid()
Get process id.
Definition: TSystem.cxx:711
void HandleSigPipe()
Called when the client is not alive anymore; terminate the session.
Int_t SetupCommon()
Common part (between TProofServ and TXProofServ) of the setup phase.
Ssiz_t Length() const
Definition: TString.h:390
virtual Bool_t IsValid() const
Definition: TSocket.h:162
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
Definition: TSocket.cxx:520
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
Definition: TSocket.cxx:1017
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:635
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
Definition: TSystem.cxx:1363
TString fSessionTag
Definition: TProofServ.h:92
Int_t Setup()
Print the ProofServ logo on standard output.
Bool_t UnlinkDataDir(const char *path)
Scan recursively the datadir and unlink it if empty Return kTRUE if it can be unlinked, kFALSE otherwise.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:892
const char *const kPROOF_WorkDir
Definition: TProof.h:147
virtual int MakeDirectory(const char *name)
Make a directory.
Definition: TSystem.cxx:821
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
Definition: TSystem.cxx:536
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
Definition: TSystem.cxx:856
Bool_t Notify()
Definition: TTimer.cxx:65
Basic string class.
Definition: TString.h:137
TAlienJobStatus * status
Definition: TAlienJob.cxx:51
int Int_t
Definition: RtypesCore.h:41
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:996
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
const char *const kRM
Definition: TProof.h:165
#define gInterpreter
Definition: TInterpreter.h:502
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Definition: TSystem.cxx:1511
TString fService
Definition: TProofServ.h:85
STL namespace.
TString & Insert(Ssiz_t pos, const char *s)
Definition: TString.h:592
virtual Int_t GetDescriptor() const
Definition: TSocket.h:142
static const char * GetMacroPath()
Get macro search path. Static utility function.
Definition: TROOT.cxx:2406
const char * Data() const
Definition: TString.h:349
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition: TSystem.cxx:847
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Definition: TSystem.cxx:1346
Int_t CreateServer()
Finalize the server setup.
TSocket * fSocket
Definition: TProofServ.h:108
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2334
#define PDB(mask, level)
Definition: TProofDebug.h:58
const char * ord
Definition: TXSlave.cxx:46
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
Definition: TROOT.cxx:2469
static volatile Int_t gProofServDebug
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1627
virtual void ExitLoop()
Exit from event loop.
Definition: TSystem.cxx:396
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
Definition: TSystem.cxx:1563
TString fDataDir
Definition: TProofServ.h:100
void FlushLogFile()
Reposition the read pointer in the log file to the very end.
TString fConfDir
Definition: TProofServ.h:88
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
TString flog
Definition: pq2main.cxx:37
TString fOrdinal
Definition: TProofServ.h:116
Int_t SetupOnFork(const char *ord)
Finalize the server setup afetr forking.
virtual Int_t Fork()
Fork a child.
const char Int_t const char TProof Int_t const char * workdir
Definition: TXSlave.cxx:46
Int_t fProtocol
Definition: TProofServ.h:115
time_t GetSec() const
Definition: TTimeStamp.h:140
TString fUser
Definition: TSystem.h:152
TProofServLite(Int_t *argc, char **argv, FILE *flog=0)
Main constructor.
static double C[]
virtual void Setenv(const char *name, const char *value)
Set environment variable.
Definition: TSystem.cxx:1611
Bool_t fIsLink
Definition: TSystem.h:143
R__EXTERN TSystem * gSystem
Definition: TSystem.h:549
TString fSessionDir
Definition: TProofServ.h:94
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
Definition: TEnv.cxx:494
TProofServLiteInterruptHandler * fInterruptHandler
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2321
void HandleFork(TMessage *mess)
Cloning itself via fork.
TMarker * m
Definition: textangle.C:8
virtual Int_t Exec(const char *shellcmd)
Execute a command.
Definition: TSystem.cxx:657
TString fUser
Definition: TProofServ.h:86
Bool_t IsNull() const
Definition: TString.h:387
virtual void FreeDirectory(void *dirp)
Free a directory.
Definition: TSystem.cxx:839
#define Printf
Definition: TGeoToOCC.h:18
TString & Remove(Ssiz_t pos)
Definition: TString.h:616
long Long_t
Definition: RtypesCore.h:50
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
Definition: TSystem.cxx:546
virtual ~TProofServLite()
Cleanup.
virtual void SendLogFile(Int_t status=0, Int_t start=-1, Int_t end=-1)
Send log file to master.
TString fTopSessionTag
Definition: TProofServ.h:93
virtual const char * HostName()
Return the system's host name.
Definition: TSystem.cxx:307
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
Definition: TSystem.cxx:1337
Bool_t IsMaster() const
Definition: TProofServ.h:305
ClassImp(TProofServLite) extern"C"
R__EXTERN TEnv * gEnv
Definition: TEnv.h:174
void Terminate(Int_t status)
Terminate the proof server.
The TTimeStamp encapsulates seconds and ns since EPOCH.
Definition: TTimeStamp.h:76
void HandleTermination()
Called when the client is not alive anymore; terminate the session.
void Throw(int code)
If an exception context has been set (using the TRY and RETRY macros) jump back to where it was set...
Definition: TException.cxx:27
const Ssiz_t kNPOS
Definition: Rtypes.h:115
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
R__EXTERN Int_t gProofDebugLevel
Definition: TProofDebug.h:56
TString fWorkDir
Definition: TProofServ.h:90
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition: TSystem.cxx:830
void RedirectOutput(const char *dir=0, const char *mode="w")
Redirect stdout to a log file.
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
Definition: TSystem.cxx:558
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
Definition: TApplication.h:45
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition: TSystem.cxx:1243
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:582
const Bool_t kTRUE
Definition: Rtypes.h:91
Int_t fLogFileDes
Definition: TProofServ.h:112
Bool_t NoLogOpt() const
Definition: TApplication.h:144
virtual Long_t ProcessFile(const char *file, Int_t *error=0, Bool_t keep=kFALSE)
Process a file containing a C++ macro.