Belle II Software  release-05-01-25
ProcessListener.cc
1 #include "daq/slc/readout/ProcessListener.h"
2 #include "daq/slc/readout/ProcessController.h"
3 
4 #include <daq/slc/runcontrol/RCCallback.h>
5 
6 #include <daq/slc/system/LogFile.h>
7 #include <daq/slc/system/Process.h>
8 
9 using namespace Belle2;
10 
11 void ProcessListener::run()
12 {
13  Process& process(m_con->getProcess());
14  std::string process_name = m_con->getParName();
15  RCCallback& callback(*(m_con->getCallback()));
16  if (not process.wait()) {
17  callback.log(LogFile::FATAL, "Failed to wait processed process %s",
18  process_name.c_str());
19  return;
20  }
21  callback.log(LogFile::DEBUG, process_name + " : termineted");
22  callback.log(LogFile::DEBUG, "%s : waitpid_returned %d status = %d", process_name.c_str(), process.waitpid_result(),
23  process.waitpid_status());
24  process.set_id(-1);
25  callback.set(m_con->getParName() + ".pid", -1);
26  /*
27  try {
28  callback.monitor();
29  } catch (const RCHandlerFatalException& e) {
30  callback.log(LogFile::FATAL, e.what());
31  } catch (const RCHandlerException& e) {
32  callback.log(LogFile::ERROR, e.what());
33  } catch (const std::exception& e) {
34  callback.log(LogFile::FATAL, "Unknown exception: %s. terminating process", e.what());
35  }
36  */
37 }
Belle2::RCCallback
Definition: RCCallback.h:18
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Process
Definition: Process.h:15