Discussion:
[Bug 217545] jail: exec.poststop not executed, mount.fstab does not umount after removing jail
(too old to reply)
b***@freebsd.org
2017-03-05 05:50:51 UTC
Permalink
Raw Message
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217545

Mark Linimon <***@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|freebsd-***@FreeBSD.org |freebsd-***@FreeBSD.org
--
You are receiving this mail because:
You are the assignee for the bug.
b***@freebsd.org
2017-03-05 17:39:31 UTC
Permalink
Raw Message
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217545

Jamie Gritton <***@FreeBSD.org> changed:

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

--- Comment #1 from Jamie Gritton <***@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.
b***@freebsd.org
2017-03-06 17:27:46 UTC
Permalink
Raw Message
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217545

Martin Birgmeier <***@aon.at> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|Closed |Open
Resolution|Works As Intended |---

--- Comment #2 from Martin Birgmeier <***@aon.at> ---
I also tried this use case:

- Executed "jail -c -f <conffile>" in one terminal
- This gives me a shell prompt in the jail
- Executed "jail -r <jailname>" in another terminal
- This kills the shell in the jail, prints "<jailname>: removed", but does not
execute the poststop script (in neither of the two terminals)

Expected behavior: The poststop script should be executed.

-- Martin
--
You are receiving this mail because:
You are the assignee for the bug.
b***@freebsd.org
2017-03-06 17:46:56 UTC
Permalink
Raw Message
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217545

Jamie Gritton <***@FreeBSD.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|Open |Closed
Resolution|--- |Unable to Reproduce

--- Comment #3 from Jamie Gritton <***@FreeBSD.org> ---
I just did a quick test as you outlined, and it worked for me. This seems more
like a Q&A issue than a bug.
--
You are receiving this mail because:
You are the assignee for the bug.
Loading...