kqueue(2) kevents for jails

Fabian Freyer fabian.freyer at physik.tu-berlin.de
Fri Jan 4 20:12:25 UTC 2019


On 1/4/19 6:20 PM, Christian Barthel wrote:
> I worked on something similar (not a library but more acting like a
> daemon).   The way I managed Jails was by forking a jail(8) process
> and collecting the exit status.  Not sure if that is possible for your
> library case.

Yes, I've thought about doing things like that too, like double-forking 
and having the parent wait for the jailed child, but those all seem 
dirty to me. Ideally, I'd like to register callbacks on jail state 
change to clean up file systems etc.

On 1/4/19 5:14 PM, Konstantin Belousov wrote:
> No, kevent(2) is not suitable mechanism to notify about jail state changes.
> If anything in the existing system can be reused for such notifications,
> it is devctl(4) notifications which are handled by devd(8).  Look at the
> man pages and for existing notifications in kernel code, e.g.
> sys/kern/kern_conf.c notify*() for how devfs does it.

Can any running binary subscribe to devd(8) events or does that require 
a configuration change in /etc/devd.conf?


More information about the freebsd-jail mailing list