Skip to content

[Story] Implement rtbox init #6

@akdev1l

Description

@akdev1l

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:

  1. Sync /etc/resolv.conf
  2. Make sure the group and user match inside/outside the host
  3. Add files to /etc/profile.d to customize the shell environment
  4. Create /run/.toolboxenv to signify that this is a toolbox environment
  5. Monitor /run/host/etc/resolv.conf and some other files, when those are modified copy them back into the container equivalents
  6. 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

  1. rtbox init can run inside the container and reap zombie processes
  2. We enable rtbox create use case
  3. rtbox init takes arguments to satisfy the toolbox init interface (this would mean we achieve backwards compat with toolbox images which would be cool)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions