Apache Mesos
|
A ChildHook
can be passed to a subprocess
call.
More...
#include <subprocess.hpp>
Public Member Functions | |
Try< Nothing > | operator() () const |
Static Public Member Functions | |
static ChildHook | CHDIR (const std::string &working_directory) |
ChildHook for changing the working directory. More... | |
static ChildHook | SETSID () |
ChildHook for generating a new session id. More... | |
static ChildHook | DUP2 (int oldFd, int newFd) |
ChildHook for duplicating a file descriptor. More... | |
static ChildHook | SUPERVISOR () |
ChildHook for starting a Supervisor process monitoring and killing the child process if the parent process terminates. More... | |
A ChildHook
can be passed to a subprocess
call.
It provides a way to inject predefined behavior between the clone and exec calls in the child process. As such ChildHooks
have to fulfill certain criteria (especially being async safe) the class does not offer a public constructor. Instead instances can be created via factory methods. NOTE: Returning an error from a childHook causes the child process to abort.
|
static |
ChildHook
for changing the working directory.
|
static |
ChildHook
for duplicating a file descriptor.
|
static |
ChildHook
for generating a new session id.
|
static |
ChildHook
for starting a Supervisor process monitoring and killing the child process if the parent process terminates.
NOTE: The supervisor process sets the process group id in order for it and its child processes to be killed together. We should not (re)set the sid after this.