#include <launch_command.h>
|
| LaunchCommandInterface ()=default |
|
virtual | ~LaunchCommandInterface ()=default |
|
virtual pid_t | launchProcess (const nlohmann::json &launcherConfig, const std::string &procCmd, const std::vector< std::string > &envParams, const std::vector< std::string > &startParams, bool appendParentEnv=true, int logFD=-1)=0 |
| Fork a new process for the given engine. Will read environment variables and start params from engineConfig The function should take the environment parameters and start parameters defined in engineConfig, and append any additional strings defined in envParams and startParams before starting the Engine specified in engineConfig. If appendParentEnv is set to true, use the parent environment in the forked child. If set to false, scrub the environment before continuing. More...
|
|
virtual pid_t | stopProcess (unsigned int killWait)=0 |
| Stop a running engine process. More...
|
|
virtual ENGINE_RUNNING_STATUS | getProcessStatus () |
| Get the current engine process status. If status cannot be retrieved, return ENGINE_RUNNING_STATUS::UNKNOWN. More...
|
|
virtual std::string_view | launchType () const =0 |
| Get launch command type. More...
|
|
◆ ENGINE_RUNNING_STATUS
Engine Process status.
Enumerator |
---|
UNKNOWN | |
RUNNING | |
STOPPED | |
◆ LaunchCommandInterface()
LaunchCommandInterface::LaunchCommandInterface |
( |
| ) |
|
|
default |
◆ ~LaunchCommandInterface()
virtual LaunchCommandInterface::~LaunchCommandInterface |
( |
| ) |
|
|
virtualdefault |
◆ getProcessStatus()
◆ launchProcess()
virtual pid_t LaunchCommandInterface::launchProcess |
( |
const nlohmann::json & |
launcherConfig, |
|
|
const std::string & |
procCmd, |
|
|
const std::vector< std::string > & |
envParams, |
|
|
const std::vector< std::string > & |
startParams, |
|
|
bool |
appendParentEnv = true , |
|
|
int |
logFD = -1 |
|
) |
| |
|
pure virtual |
Fork a new process for the given engine. Will read environment variables and start params from engineConfig The function should take the environment parameters and start parameters defined in engineConfig, and append any additional strings defined in envParams and startParams before starting the Engine specified in engineConfig. If appendParentEnv is set to true, use the parent environment in the forked child. If set to false, scrub the environment before continuing.
- Parameters
-
launcherConfig | Configuration specific to the launch command |
procCmd | Process command |
envParams | Additional Environment Variables for Engine process. Will take precedence over default env params if appendParentEnv is true |
startParams | Additional Start parameters |
appendParentEnv | Should parent env variables be appended to Engine process |
- Returns
- Returns PID of child process on success
Implemented in BasicFork, DockerLauncher, and EmptyLaunchCommand.
◆ launchType()
virtual std::string_view LaunchCommandInterface::launchType |
( |
| ) |
const |
|
pure virtual |
◆ stopProcess()
virtual pid_t LaunchCommandInterface::stopProcess |
( |
unsigned int |
killWait | ) |
|
|
pure virtual |
Stop a running engine process.
- Parameters
-
killWait | Time (in seconds) to wait for process to quit by itself before force killing it. 0 means it will wait indefinetly |
- Returns
- Returns 0 on success, negative value on error
Implemented in EmptyLaunchCommand, BasicFork, and DockerLauncher.
The documentation for this class was generated from the following file:
- nrp_general_library/nrp_general_library/process_launchers/launch_commands/launch_command.h