Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Mar 2017 17:39:31 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-jail@FreeBSD.org
Subject:   [Bug 217545] jail: exec.poststop not executed, mount.fstab does not umount after removing jail
Message-ID:  <bug-217545-9824-njxawFSoZH@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-217545-9824@https.bugs.freebsd.org/bugzilla/>
References:  <bug-217545-9824@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217545

Jamie Gritton <jamie@FreeBSD.org> changed:

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

--- Comment #1 from Jamie Gritton <jamie@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 yo=
u'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 r=
an
"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 - genera=
lly
the command is something like "sh /etc/rc" which starts daemons which conti=
nue
to run.  If all commands complete, and the jail isn't marked with the "pers=
ist"
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 whi=
ch
thus cannot running any of the shutdown commands.

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

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-217545-9824-njxawFSoZH>