[Bug 222951] Re-starting a jail with mount.devfs mounts devfs multiple times

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 17 Jan 2023 10:02:31 UTC

--- Comment #2 from Zhenlei Huang <zlei@FreeBSD.org> ---
(In reply to VK from comment #0)

> The problem seems to be when the (nopersist) jail is stopped by itself because all
> the processes in it have exited, so it wasn't explicitly `jail -r`. When that 
> happens, devfs is not unmounted.

For non-persist jails I think this is the expected behavior.
`mount.devfs` is a pseudo-parameter and as per jail(8):
>  There are pseudo-parameters that are not passed to the kernel, but are
>     used by jail to set up the jail environment, often by running specified
>     commands when jails are created or removed.

> So next time the jail is started, devfs is mounted again, resulting with multiple 
> mounts of devfs into $JAIL_ROOT/dev:

Maybe we can teach /usr/sbin/jail to check existing mount of devfs(5) before
starting jails.

You are receiving this mail because:
You are the assignee for the bug.