svn commit: r336730 - projects/bectl/sbin/bectl

Kyle Evans kevans at freebsd.org
Thu Jul 26 03:32:04 UTC 2018


On Wed, Jul 25, 2018 at 10:14 PM, Kyle Evans <kevans at freebsd.org> wrote:
> Author: kevans
> Date: Thu Jul 26 03:14:58 2018
> New Revision: 336730
> URL: https://svnweb.freebsd.org/changeset/base/336730
>
> Log:
>   bectl(8): Support unjailing a boot environment
>
>   The given parameter may either be a jid, jail name, or a BE name.  In all
>   cases, the parameter will be resolved to a jid and bectl(8) will
>   sanity-check that there's actually a BE mounted at the requested jail root
>   before invoking jail_remove(2).

It was probably also worth mentioning that this will currently leave
the mount point hanging around to be unmounted manually. This was a
conscious decision- at the moment, `bectl jail` will throw you into a
shell inside the jail. Exiting the shell will clean up the jail and
the mount appropriately, leaving 'unjail' for edge cases where this
cleanup didn't get to happen -- but that won't always be the case.

I waffled on whether or not unjail will be useful for removing the
mount in the current world, and decided against it for now. The jail
command will be getting modified to instead use jail API to create the
jail then exec sh inside, at which point I will likely make 'unjail'
properly remove the mount as the user will be free to go in and out of
jail without worrying about it getting cleaned up upon 'exit'.


More information about the svn-src-projects mailing list