-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem
In order to maintain control of the container life-cycle the original toolbox sets itself as the init process for the container.
It also takes some steps to prepare the container for usage and theoretically tries to keep some files inside the container in sync with the host. From studying toolbox code I remember these steps:
- Sync /etc/resolv.conf
- Make sure the group and user match inside/outside the host
- Add files to /etc/profile.d to customize the shell environment
- Create /run/.toolboxenv to signify that this is a toolbox environment
- Monitor /run/host/etc/resolv.conf and some other files, when those are modified copy them back into the container equivalents
- Reap zombie processes as an init system would
Solution
We can solve this by implementing a minimal init system in rust that will just reap zombie processes. I prefer to let podman handle container environment initialization by passing the correct --args to podman. For example we can use --hostname argument to add the correct hostnames inside the container namespace or we can use bind mounts instead of monitoring and copying files.
Need some investigation to find equivalent args for the behaviour observed.
Acceptance Criteria
rtbox initcan run inside the container and reap zombie processes- We enable
rtbox createuse case rtbox inittakes arguments to satisfy thetoolbox initinterface (this would mean we achieve backwards compat with toolbox images which would be cool)