Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements executing the init system #177

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mildred
Copy link

@mildred mildred commented May 27, 2019

Add the toolbox recreate sub command

The recreate command is saving the current container as a new image, removing the container, and recreating a new container with all the updated options.

Implements debarshiray/toolbox#143

Allow to run systemd within the container

debarshiray/toolbox#176

Add an --init option to create or recreate a container with a split PID namespace. In such circumstances, the /sbin/init is executed instead of sleep. Toolbox shells are then able to access systemd using systemctl.

@mildred
Copy link
Author

mildred commented May 27, 2019

Updated the PR to make this dependent upon the --init command-line option

@ibotty
Copy link

ibotty commented Jun 19, 2019

Any updates? Is that a viable approach? Would that possibly get merged if the conflicts get resolved?

@mildred
Copy link
Author

mildred commented Jul 19, 2019

Just updated this PR on top of latest master, and removed the recreate command to simplify this PR.

I'm using this feature and it works well.

@mildred
Copy link
Author

mildred commented Aug 28, 2019

I'm using containers created by this PR daily and it works really great.

@mjburling
Copy link

mjburling commented Nov 7, 2019

Perhaps the use-case for running an RDBMs is too high-minded. From toolbox, I just don't want to have to run:

  1. emacs --daemon=foo
  2. emacsclient --socket-name=foo --create-frame &

This seems to be able to satisfy the systemd requirements... What's holding up the merge?

The --init option is available at container creation or recreation. When
enabled, a PID namespace is created for the init system to work properly
and toolbox shells will not be able to access the host PID namespace.
It ensures that /run is a tmpfs, and in case when systemd is running as
init system, systemd will avoid re-mounting it, causing /run/host and
other bind-mounts to be shadowed.
When running an init, the dBus socket must point to the toolbox
system and not the host.
@mildred
Copy link
Author

mildred commented Nov 28, 2019

Just rebased my branch to latest master. If someone can take a look at it, I would be grateful. The change is really light (just replace the sleep by init and change just a few container options : unshare pid namespace, host dbus and mount /run as tmpfs)

@mildred mildred changed the title Implements executing the init system and the toolbox recreate command Implements executing the init system Nov 28, 2019
This is necessary when the pid namespace is unshared because the PID is
not the same inside and out of the container.
@mildred
Copy link
Author

mildred commented Nov 28, 2019

Sorry, this is no longer working with the newer version. And having journald mounted from within the container does not work.

@HarryMichal HarryMichal added the 3. Enhancement Improvement to an existing feature label Dec 5, 2019
Base automatically changed from master to main March 25, 2021 22:25
@bam80
Copy link

bam80 commented May 2, 2024

Progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. Enhancement Improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants