Bug 245167 - sysutils/ezjail does not properly shutdown jails
Summary: sysutils/ezjail does not properly shutdown jails
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-29 15:21 UTC by ml
Modified: 2020-03-29 15:21 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (erdgeist)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ml 2020-03-29 15:21:22 UTC
Issuing "ezjail stop {jailname}" does NOT run shutdown script inside the jail; instead it seems it just kills the jailed processes badly.
This can be a problem in several situations.

I was recently bitten by this, but see it was discussed several times earlier. E.g.:
https://forums.freebsd.org/threads/jails-are-not-shutdown-during-reboot.51017/



The problem can be solved by changing jail_{jailname}_exec_stop in ${PREFIX}/etc/ezjail/{jailname}. This has to be done for every single jail.
Somewhere it is suggested this can be done globally, by putting ezjail_exec_stop="/bin/sh /etc/rc.shutdown"
in ${PREFIX}/etc/ezjail.conf, but this did not work for me.



I understand there is no global consensus on whether rc.shutdown should be called at jail stop; also I thinks FreeBSD base system's jail command defaults to NOT running it.
However, ezjail(7) says:
 jail_JAILNAME_exec_stop
             The command to run inside the jail when stopping it. Defaults to
             the empty string, which means "/bin/sh /etc/rc.shutdown".

So either the default is really changed or the manual page should be corrected.