|
FlatImage
A configurable Linux containerization system
|
Child process spawning and I/O management for portal IPC. More...
Functions | |
| Value< void > | write_fifo (int const value, fs::path const &path_fifo) |
| Writes a value to a fifo given a file path. | |
| Value< void > | spawn (std::vector< std::string > const &vec_argv, ns_db::ns_portal::ns_message::Message const &message) |
| Forks a child process and waits for it to complete. | |
| Value< void > | spawn (ns_daemon::ns_log::Logs logs, ns_message::Message const &message) |
| Forks and executes a new child process. | |
Child process spawning and I/O management for portal IPC.
This namespace handles the creation and management of child processes for the portal system. It provides functions for spawning processes with their standard I/O streams redirected to FIFO pipes, enabling communication between host and containerized processes. The spawned processes can have custom environments and communicate their PID and exit codes through FIFOs.
|
inlinenodiscard |
Forks and executes a new child process.
Sets up child logging, extracts the command from the message, and spawns the child process. This function exits the parent process after spawning.
| logs | Logging configuration with paths for log files |
| message | The message containing the command, environment, and FIFO paths |
Definition at line 159 of file child.hpp.
|
inlinenodiscard |
Forks a child process and waits for it to complete.
Spawns a child process with the specified command and arguments, redirects its stdio to pipes, and waits for it to exit. Communicates the child's PID and exit code through FIFOs to the portal daemon.
| logs | Logging configuration with paths for log files |
| vec_argv | Arguments to the child process (first element is the command) |
| message | Message containing FIFO paths and environment for IPC |
Definition at line 79 of file child.hpp.
|
inlinenodiscard |
Writes a value to a fifo given a file path.
Opens the fifo file with a timeout of SECONDS_TIMEOUT and writes the data
| value | The value to write as a single integer constant |
| path_fifo | The path to the fifo file to open and write the data to |
Definition at line 53 of file child.hpp.