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

Limited support for pkg/unshare on FreeBSD #1240

Merged
merged 1 commit into from May 13, 2022

Conversation

dfr
Copy link
Contributor

@dfr dfr commented May 12, 2022

This does not really 'unshare' anything but does implement the setsid,
setpgrp and ctty options as well as the pipe-based signalling protocol
with the parent process which made it slightly easier to port buildah's
chroot isolation mechanism.

Signed-off-by: Doug Rabson dfr@rabson.org

@rhatdan
Copy link
Member

rhatdan commented May 12, 2022

@nalind @giuseppe PTAL

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nalind
Copy link
Member

nalind commented May 12, 2022

OOMScoreAdj is in the non-Linux version of the Cmd struct, but it seems to be ignored. Should it be there?

@dfr
Copy link
Contributor Author

dfr commented May 12, 2022

OOMScoreAdj is in the non-Linux version of the Cmd struct, but it seems to be ignored. Should it be there?

I will remove it - as you can see its not implemented here and I'm not sure if there is a direct equivalent

@nalind
Copy link
Member

nalind commented May 12, 2022

The FreeBSD implementation could probably stand to drop the _Containers-unshare environment variable, which the Linux implementation uses for passing flags for unshare() down to the child process, but which doesn't appear to serve a purpose in the FreeBSD version.

Go ahead and move bailOnError from unshare_linux.go to unshare.go to avoid having to duplicate it in unshare_freebsd.go.

@dfr
Copy link
Contributor Author

dfr commented May 13, 2022

I've updated the branch with the suggested changes, please take a look.

This does not really 'unshare' anything but does implement the setsid,
setpgrp and ctty options as well as the pipe-based signalling protocol
with the parent process which made it slightly easier to port buildah's
chroot isolation mechanism.

Signed-off-by: Doug Rabson <dfr@rabson.org>
@rhatdan
Copy link
Member

rhatdan commented May 13, 2022

LGTM

@rhatdan rhatdan merged commit 877a26a into containers:main May 13, 2022
@dfr dfr deleted the freebsd-unshare branch June 13, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants