52 Signal(
int pid,
int signalNumber,
const std::string& signalName,
const std::string& name)
54 if (::kill(pid, signalNumber) == 0)
59 const int errorNumber = errno;
60 ARMARX_WARNING_S <<
"Could not send " << signalName <<
" to application " << name
61 <<
" (pid " << pid <<
"): " << ::strerror(errorNumber)
62 << (errorNumber == EPERM
63 ?
". The pid belongs to a process this ScenarioManager may not "
64 "signal, so it is most likely not this application."
72 const int pid = application->getPid();
75 ARMARX_INFO_S <<
"Stopping application " << application->getName() <<
" (pid " << pid
77 Signal(pid, SIGTERM,
"SIGTERM", application->getName());
82 <<
": no pid known for it (it is not running, or it was not started by "
83 "this ScenarioManager).";
90 const int pid = application->getPid();
93 ARMARX_INFO_S <<
"Killing application " << application->getName() <<
" (pid " << pid <<
")";
94 Signal(pid, SIGKILL,
"SIGKILL", application->getName());
99 <<
": no pid known for it (it is not running, or it was not started by "
100 "this ScenarioManager).";
void kill(Data_Structure::ApplicationInstancePtr application) override
Kills an application based on its pid.
void stop(Data_Structure::ApplicationInstancePtr application) override
Stops an application based on its pid.
#define ARMARX_WARNING_S
The logging level for unexpected behaviour, but not a serious problem.
std::shared_ptr< ApplicationInstance > ApplicationInstancePtr