32#include "RConfigure.h"
41#include <netinet/in.h>
65#include "compiledata.h"
86Bool_t TProofServLiteInterruptHandler::Notify()
88 fServ->HandleUrgentData();
109Bool_t TProofServLiteSigPipeHandler::Notify()
111 fServ->HandleSigPipe();
129Bool_t TProofServLiteTerminationHandler::Notify()
131 Printf(
"TProofServLiteTerminationHandler::Notify: wake up!");
133 fServ->HandleTermination();
151Bool_t TProofServLiteSegViolationHandler::Notify()
154 Printf(
"**** Segmentation violation: terminating ****");
156 fServ->HandleTermination();
175Bool_t TProofServLiteInputHandler::Notify()
177 fServ->HandleSocketInput();
209 Info(
"CreateServer",
"starting server creation");
215 Error(
"CreateServer",
"resolving the log file description number");
223 Error(
"CreateServer",
"Socket setup by xpd undefined");
233 Error(
"CreateServer",
"Failed to open connection to the client");
257 Info(
"CreateServer",
"Service: %s, ConfDir: %s, IsMaster: %d",
352 Error(
"Setup",
"failed to send proof server startup message");
358 Error(
"Setup",
"remote proof protocol missing");
388 Error(
"Setup",
"Session dir missing");
410 Error(
"Setup",
"common setup failed");
441 Info(
"Terminate",
"starting session termination operations ...");
466 Printf(
"Terminate: termination operations ended: quitting!");
475 Error(
"HandleFork",
"empty message!");
483 Info(
"HandleFork",
"cloning to %s", clones.
Data());
487 while (clones.
Tokenize(clone, from,
" ")) {
491 if ((rc =
Fork()) < 0) {
492 Error(
"HandleFork",
"failed to fork %s", clone.
Data());
514 Info(
"SetupOnFork",
"finalizing setup of %s", ord);
548 Info(
"SetupOnFork",
"unlinking: %s", ent.
Data());
571 Error(
"CreateServer",
"Socket setup by xpd undefined");
581 Error(
"CreateServer",
"Failed to open connection to the client");
605 Info(
"SetupOnFork",
"Service: %s, ConfDir: %s, IsMaster: %d",
void Throw(int code)
If an exception context has been set (using the TRY and RETRY macros) jump back to where it was set.
R__EXTERN Int_t gProofDebugLevel
static volatile Int_t gProofServDebug
TApplication * GetTProofServLite(Int_t *argc, char **argv, FILE *flog)
const char *const kPROOF_WorkDir
void Printf(const char *fmt,...)
@ kSigSegmentationViolation
R__EXTERN TSystem * gSystem
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
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 Long_t ProcessFile(const char *file, Int_t *error=0, Bool_t keep=kFALSE)
Process a file containing a C++ macro.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
virtual Bool_t Notify()
Notify when event occurred on descriptor associated with this handler.
virtual Bool_t ReadNotify()
Notify when something can be read from the descriptor associated with this handler.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Version of the PROOF worker server for local running.
Int_t CreateServer()
Finalize the server setup.
void HandleSigPipe()
Called when the client is not alive anymore; terminate the session.
TProofServLiteInterruptHandler * fInterruptHandler
Int_t SetupOnFork(const char *ord)
Finalize the server setup afetr forking.
void HandleFork(TMessage *mess)
Cloning itself via fork.
virtual ~TProofServLite()
Cleanup.
Int_t Setup()
Print the ProofServ logo on standard output.
void Terminate(Int_t status)
Terminate the proof server.
void HandleTermination()
Called when the client is not alive anymore; terminate the session.
Class providing the PROOF server.
void FlushLogFile()
Reposition the read pointer in the log file to the very end.
void RedirectOutput(const char *dir=0, const char *mode="w")
Redirect stdout to a log file.
Int_t SetupCommon()
Common part (between TProofServ and TXProofServ) of the setup phase.
friend class TProofServLite
virtual Int_t Fork()
Fork a child.
Bool_t UnlinkDataDir(const char *path)
Scan recursively the datadir and unlink it if empty Return kTRUE if it can be unlinked,...
virtual void SendLogFile(Int_t status=0, Int_t start=-1, Int_t end=-1)
Send log file to master.
static const char * GetMacroPath()
Get macro search path. Static utility function.
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
virtual Bool_t Notify()
Notify when signal occurs.
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
virtual Int_t GetDescriptor() const
virtual Bool_t IsValid() const
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
TString & Insert(Ssiz_t pos, const char *s)
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual void AddFileHandler(TFileHandler *fh)
Add a file handler to the list of system file handlers.
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual int GetPid()
Get process id.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual int MakeDirectory(const char *name)
Make a directory.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
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.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual void ExitLoop()
Exit from event loop.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
virtual const char * HostName()
Return the system's host name.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
virtual void Setenv(const char *name, const char *value)
Set environment variable.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
The TTimeStamp encapsulates seconds and ns since EPOCH.
static constexpr double s