[Bug 217545] jail: exec.poststop not executed, mount.fstab does not umount after removing jail

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Mar 5 17:39:31 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217545

Jamie Gritton <jamie at FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamie at FreeBSD.org
         Resolution|---                         |Works As Intended
             Status|New                         |Closed

--- Comment #1 from Jamie Gritton <jamie at FreeBSD.org> ---
Filesystems mounted with mount.fstab are indeed unmounted when a jail is
stopped, and the exec.poststop command(s) are indeed executed.  But what you're
doing isn't jail removal.

Am existing jail is removed by running "jail -r", which will run the prestop
and stop commands, actually remove the jail, then run poststop commands and
then clean up mounts and IP address assignments.  But note that you never ran
"jail -r".

When a jail is created, it will (among other things) run the exec.start and/or
"command" commands.  Those commands are not expected to all finish - generally
the command is something like "sh /etc/rc" which starts daemons which continue
to run.  If all commands complete, and the jail isn't marked with the "persist"
parameter, the jail will naturally die on its own.  That has nothing to do with
the jail(8) command, which is likely no longer running at the time, and which
thus cannot running any of the shutdown commands.

If you intend on running jails this way, I recommend unmounting the filesystems
not in exec.poststop, but in exec.poststart which runs as the last step in the
creation process.

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


More information about the freebsd-jail mailing list