Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jan 2019 21:11:58 +0100
From:      Fabian Freyer <fabian.freyer@physik.tu-berlin.de>
To:        Christian Barthel <bch@online.de>, Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-jail@freebsd.org, stefan@gronke.net
Subject:   Re: kqueue(2) kevents for jails
Message-ID:  <ae977530-0297-d404-f34d-90762bc7da7a@physik.tu-berlin.de>
In-Reply-To: <87k1jkmja7.fsf@x230.onfire.org>
References:  <106dc2ec-9b92-6885-ca4c-8422e0aa061c@physik.tu-berlin.de> <87k1jkmja7.fsf@x230.onfire.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ae977530-0297-d404-f34d-90762bc7da7a>