32 #include "RConfigure.h" 41 #include <netinet/in.h> 43 #include <sys/types.h> 65 #include "compiledata.h" 86 Bool_t TProofServLiteInterruptHandler::Notify()
88 fServ->HandleUrgentData();
109 Bool_t TProofServLiteSigPipeHandler::Notify()
111 fServ->HandleSigPipe();
129 Bool_t TProofServLiteTerminationHandler::Notify()
131 Printf(
"TProofServLiteTerminationHandler::Notify: wake up!");
133 fServ->HandleTermination();
151 Bool_t TProofServLiteSegViolationHandler::Notify()
154 Printf(
"**** Segmentation violation: terminating ****");
156 fServ->HandleTermination();
163 class TProofServLiteInputHandler :
public TFileHandler {
169 Bool_t ReadNotify() {
return Notify(); }
175 Bool_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");
226 TString entity =
gEnv->
GetValue(
"ProofServ.Entity",
"");
227 if (entity.Length() > 0)
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");
379 if (fTopSessionTag.IsNull()) fTopSessionTag =
fSessionTag;
388 Error(
"Setup",
"Session dir missing");
396 if (iord !=
kNPOS) logfile.Remove(iord);
406 Info(
"Setup",
"working directory set to %s",
fWorkDir.Data());
410 Error(
"Setup",
"common setup failed");
441 Info(
"Terminate",
"starting session termination operations ...");
455 Info(
"Terminate",
"data directory '%s' has been removed",
fDataDir.Data());
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);
543 ent.Form(
"%s/%s", sdir.Data(),
e);
546 if (st.
fIsLink && ent.Contains(sord)) {
548 Info(
"SetupOnFork",
"unlinking: %s", ent.Data());
561 logfile.ReplaceAll(
"-0.0", sord.Data());
563 Int_t iord = logfile.Index(sord.Data());
564 if (iord !=
kNPOS) logfile.Remove(iord + sord.Length());
571 Error(
"CreateServer",
"Socket setup by xpd undefined");
574 TString entity =
gEnv->
GetValue(
"ProofServ.Entity",
"");
575 if (entity.Length() > 0)
581 Error(
"CreateServer",
"Failed to open connection to the client");
605 Info(
"SetupOnFork",
"Service: %s, ConfDir: %s, IsMaster: %d",
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
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 Bool_t IsValid() const
virtual int GetPid()
Get process id.
Version of the PROOF worker server for local running.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
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.
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
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.
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.
const char *const kPROOF_WorkDir
virtual int MakeDirectory(const char *name)
Make a directory.
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
virtual Bool_t ChangeDirectory(const char *path)
Change directory.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
static const char * GetMacroPath()
Get macro search path. Static utility function.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Int_t CreateServer()
Finalize the server setup.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
TApplication * GetTProofServLite(Int_t *argc, char **argv, FILE *flog)
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
static volatile Int_t gProofServDebug
virtual const char * Getenv(const char *env)
Get environment variable.
virtual void ExitLoop()
Exit from event loop.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
void FlushLogFile()
Reposition the read pointer in the log file to the very end.
Int_t SetupOnFork(const char *ord)
Finalize the server setup afetr forking.
virtual Int_t Fork()
Fork a child.
TProofServLite(Int_t *argc, char **argv, FILE *flog=0)
Main constructor.
virtual void Setenv(const char *name, const char *value)
Set environment variable.
R__EXTERN TSystem * gSystem
Class providing the PROOF server.
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
TProofServLiteInterruptHandler * fInterruptHandler
void HandleFork(TMessage *mess)
Cloning itself via fork.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
virtual ~TProofServLite()
Cleanup.
virtual void SendLogFile(Int_t status=0, Int_t start=-1, Int_t end=-1)
Send log file to master.
virtual const char * HostName()
Return the system's host name.
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
void Terminate(Int_t status)
Terminate the proof server.
The TTimeStamp encapsulates seconds and ns since EPOCH.
void HandleTermination()
Called when the client is not alive anymore; terminate the session.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
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
virtual Int_t GetDescriptor() const
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
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.
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual Long_t ProcessFile(const char *file, Int_t *error=0, Bool_t keep=kFALSE)
Process a file containing a C++ macro.