Box Daemon.
More...
Box Daemon.
The box daemon is responsible for spawning and managing boxes.
Spawning Boxes
To spawn a box a request should be sent to the "boxspawn" socket in the format:
Where the following values can be specified:
stdin: A shared file descriptor to use as standard input.
stdout: A shared file descriptor to use as standard output.
stderr: A shared file descriptor to use as standard error.
group: A shared file descriptor to use as the process group (/proc/[pid]/group)
namespace: A shared file descriptor to use as the process namespace (/proc/[pid]/ns).
- Note
- The
stdin, stdout, stderr and group values will only be used if the box is a foreground box, meanwhile the namespace will only be used if the box uses the inherit sandbox profile.
- Todo:
- Implement group and namespace specification for foreground boxes and the inherit profile.
The "boxspawn" socket will send a response in the format:
<background|foreground [key]|error [
msg]>
On success, the response will either contain background if the box is a background box, or foreground followed by a key for the boxes /proc/[pid]/wait file if the box is a foreground box.
On failure, the response will contain error followed by an error message.
- Todo:
- Once filesystem servers are implemented the box deamon should use them instead of sockets.
- Todo:
- Add a system for specifying environment variables.
◆ ARGV_MAX
◆ BUFFER_MAX
◆ box_args_parse()
◆ box_spawn()
◆ main()
- Todo:
- Use nonblocking sockets to avoid hanging on accept or read, or just wait until we have filesystem servers and do that instead.
Definition at line 405 of file main.c.
◆ input
◆ result
◆ box
◆ argv
◆ argc
◆ stdio
| fd_t box_args_t::stdio[3] |
◆ group