Skip to content

Limited support for pkg/unshare on FreeBSD#1240

Merged
rhatdan merged 1 commit intocontainers:mainfrom
dfr:freebsd-unshare
May 13, 2022
Merged

Limited support for pkg/unshare on FreeBSD#1240
rhatdan merged 1 commit intocontainers:mainfrom
dfr:freebsd-unshare

Conversation

@dfr
Copy link
Copy Markdown
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
Copy Markdown
Member

rhatdan commented May 12, 2022

@nalind @giuseppe PTAL

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 dfr force-pushed the freebsd-unshare branch from 35174b9 to b193f00 Compare May 13, 2022 10:07
@dfr
Copy link
Copy Markdown
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
Copy Markdown
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.

4 participants