-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fix mounts for FreeBSD #5472
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
Fix mounts for FreeBSD #5472
Conversation
|
Hi @gizahNL. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
All files in containerd need the proper copyright/license header; this checked by CI so you will need update the commit for the 2 new files. Thanks! |
Will do, thx! |
|
Build succeeded.
|
|
Thanks for the contribution! Please sign your commit using |
Signed-off-by: Gijs Peskens <[email protected]>
Signed-off-by: Gijs Peskens <[email protected]>
|
Build succeeded.
|
|
/ok-to-test |
oci/mounts_freebsd.go
Outdated
| { | ||
| Destination: "/dev/fd", | ||
| Type: "fdescfs", | ||
| Source: "fdescfs", | ||
| Options: []string{}, | ||
| }, | ||
| { | ||
| Destination: "/dev/mqueue", | ||
| Type: "mqueue", | ||
| Source: "mqueue", | ||
| Options: []string{"nosuid", "noexec"}, | ||
| }, | ||
| { | ||
| Destination: "/dev/shm", | ||
| Type: "tmpfs", | ||
| Source: "shm", | ||
| Options: []string{"nosuid", "noexec", "mode=1777"}, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I admit to being very much a newbie with FreeBSD, but I'm wondering whether these are the right defaults. On my FreeBSD host (outside a jail) I only have devfs mounted at /dev. /dev/fd appears to be provided by devfs, and the same is true in the jails that I've set up with runj. I don't have /dev/shm or /dev/mqueue at all on my host either.
$ mount
zroot/ROOT/default on / (zfs, local, noatime, nfsv4acls)
devfs on /dev (devfs, local, multilabel)
zroot/tmp on /tmp (zfs, local, noatime, nosuid, nfsv4acls)
zroot/usr/home on /usr/home (zfs, local, noatime, nfsv4acls)
zroot/var/log on /var/log (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot on /zroot (zfs, local, noatime, nfsv4acls)
zroot/usr/ports on /usr/ports (zfs, local, noatime, nosuid, nfsv4acls)
zroot/var/audit on /var/audit (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/usr/src on /usr/src (zfs, local, noatime, nfsv4acls)
zroot/var/crash on /var/crash (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/var/mail on /var/mail (zfs, local, nfsv4acls)
zroot/var/tmp on /var/tmp (zfs, local, noatime, nosuid, nfsv4acls)
zroot/containerd on /var/lib/containerd/io.containerd.snapshotter.v1.zfs (zfs, local, noatime, nfsv4acls)
zroot/containerd/44 on /run/containerd/io.containerd.runtime.v2.task/default/test2/rootfs (zfs, local, noatime, nfsv4acls)
devfs on /run/containerd/io.containerd.runtime.v2.task/default/test2/rootfs/dev (devfs, local, multilabel)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The man page for fdescfs answers at least the question of /dev/fd being provided by devfs, but I'd still like to understand more about whether these are the appropriate defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at my jails (setup via cbsd), I have fdescfs mounted for all of them, the other mounts are indeed not present.
/dev/shm is a Linuxism, and I should remove that, my first intention was to make sure mount doesn't explode when it tries to mount filesystems that are not native to FreeBSD. /dev/mqueue is also save to remove I'd say, it doesn't seem to be mounted anywhere either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fixup tonight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at my jails (setup via cbsd), I have fdescfs mounted for all of them, the other mounts are indeed not present.
Should fdescfs be present by default though? It doesn't seem to be mounted by default in the FreeBSD host I've been using that I installed without much customization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216985 and FreeBSD's ports, bash and OpenJDK need fdescfs.
So questions are;
- Do we want to provide a minimal set or good enough default to run common programs?
- Are bash and/or OpenJDK considered "common" to mount fdescfs by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bash and OpenJDK needing fdescfs sounds like a good reason to mount it by default to me.
Signed-off-by: Gijs Peskens <[email protected]>
|
Build succeeded.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (See note below)
One of the committers will need to hit the approve button so CI can run. I also haven't implemented mount in runj yet (though I see you did in your fork) so I haven't been able to test it.
|
Integration test failures appear to be unrelated. |
oci/mounts_freebsd.go
Outdated
| Destination: "/dev", | ||
| Type: "devfs", | ||
| Source: "devfs", | ||
| Options: []string{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been using ruleset=4 in runj so far. A somewhat more-restrictive default might be useful here and the jail(8) manual page suggests using 4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been my intention to pass devfs rule options in a (yet to be defined) OCI specification for FreeBSD.
ruleset=4 sounds like a safe default for the meantime though :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not completely relevant for this PR, but I'm curious to know why you are thinking of embedding devfs rule options in a FreeBSD section rather than mount options. Were you planning to allow for full ruleset definitions rather than referencing existing rulesets?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Note: dismissing previous LGTM to track the addition of the default ruleset option prior to merging.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes allowing to build a complete devfs ruleset has been the intention.
FreeBSD allows the ruleset to be specified at mount time, but also allows later modifications of a devfs mountpoint via the CLI devfs tool, even changing the ruleset (rulesets in essence basically just being a series of show and hide commands).
So I'd think having a node in a FreeBSD OCI spec that allows specification of a ruleset & a list of actions to take on the dev mountpoint would be usefull.
samuelkarp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Note: dismissing previous LGTM to track the addition of the default ruleset option prior to merging.)
oci/mounts_freebsd.go
Outdated
| Destination: "/dev", | ||
| Type: "devfs", | ||
| Source: "devfs", | ||
| Options: []string{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Note: dismissing previous LGTM to track the addition of the default ruleset option prior to merging.)
|
I've now implemented mount support in runj and tested this change. I'd still like to see the |
Signed-off-by: Gijs Peskens <[email protected]>
done. |
|
Build succeeded.
|
samuelkarp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@estesp Can you hit the approve button to run GitHub Actions?
Neither @samuelkarp nor I can do that. |
estesp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Move the default mounts definition to platform specific function & implement the correct mounts definition for FreeBSD