Date: Wed, 01 May 2019 08:53:18 -0600 From: James Gritton <jamie@freebsd.org> To: freebsd-jail@freebsd.org Cc: squiggly foo <foo.squiggly@yandex.com> Subject: Re: Application Jail Shutdown Problem Message-ID: <9f04fc825b4a931e51c4d7fd5d7ed7e0@freebsd.org> In-Reply-To: <22066461556647435@iva8-3b901672a9c5.qloud-c.yandex.net> References: <22066461556647435@iva8-3b901672a9c5.qloud-c.yandex.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2019-04-30 12:03, squiggly foo wrote: > Hi All, > > I use the mount.fstab parameter to mount a number of file systems > before starting a jail which works without any problem. However since > it is an application jail, there are no other processes running inside > the jail other than the one application. As soon as that application > terminates the jail is removed by the host. > > This is actually my preferred behavior; I want the jail to be removed > when the process inside of it terminates. But the problem is that the > mount points are not unmounted after the jail is removed that way. > The only way I can get the jails to unmount is if I do a "jail -r > jailname" which is what I want to avoid as I would not do that while > the process inside the jail is still running. > > > Does anyone know of a way for the jails to umount the mount points in > its fstab file when the only process inside the jail exits? No easy way. Those filesystems have to be unmounted by somebody; the jail can't do it because it doesn't have the permission (because it didn't mount them). So some process needs to be watching to see when the jail goes away. That would be some kind of watcher that wakes up occasionally and sees if the jail is still there. It might be nice to have some kqueue support for jails. - Jamie
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9f04fc825b4a931e51c4d7fd5d7ed7e0>