#include <basic_fork.h>
|
| ~BasicFork () override |
|
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) override |
| 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...
|
|
pid_t | stopProcess (unsigned int killWait) override |
| Stop a running engine process. More...
|
|
ENGINE_RUNNING_STATUS | getProcessStatus () override |
| Get the current engine process status. If status cannot be retrieved, return ENGINE_RUNNING_STATUS::UNKNOWN. More...
|
|
Public Member Functions inherited from LaunchCommand< LAUNCH_COMMAND > |
std::string_view | launchType () const override final |
| Get launch command type. More...
|
|
Public Member Functions inherited from LaunchCommandInterface |
| LaunchCommandInterface ()=default |
|
virtual | ~LaunchCommandInterface ()=default |
|
◆ ~BasicFork()
BasicFork::~BasicFork |
( |
| ) |
|
|
override |
◆ getProcessStatus()
◆ launchProcess()
pid_t BasicFork::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 |
|
) |
| |
|
overridevirtual |
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
Implements LaunchCommandInterface.
◆ stopProcess()
pid_t BasicFork::stopProcess |
( |
unsigned int |
killWait | ) |
|
|
overridevirtual |
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
Implements LaunchCommandInterface.
The documentation for this class was generated from the following files:
- nrp_general_library/nrp_general_library/process_launchers/launch_commands/basic_fork.h
- nrp_general_library/nrp_general_library/process_launchers/launch_commands/basic_fork.cpp