Bug 222951 - Re-starting a jail with mount.devfs mounts devfs multiple times
Summary: Re-starting a jail with mount.devfs mounts devfs multiple times
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-jail mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-12 13:07 UTC by VK
Modified: 2019-02-06 09:59 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description VK freebsd_triage 2017-10-12 13:07:17 UTC
Starting a jail that's configured with 'mount.devfs' with `jail -c` does not check if devfs is already mounted and mounts it again.

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.

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

> % mount | grep /zroot/jails/test/dev
> devfs on /zroot/jails/test/dev (devfs, local, multilabel)
> devfs on /zroot/jails/test/dev (devfs, local, multilabel)
> devfs on /zroot/jails/test/dev (devfs, local, multilabel)
> devfs on /zroot/jails/test/dev (devfs, local, multilabel)

If the jail is explicitly stopped with `jail -r`, devfs is unmounted.