From owner-freebsd-jail@freebsd.org Fri Jan 4 20:29:18 2019 Return-Path: Delivered-To: freebsd-jail@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42A1A1438DDF for ; Fri, 4 Jan 2019 20:29:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D1D782C93 for ; Fri, 4 Jan 2019 20:29:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x04KTAOH029426 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 4 Jan 2019 22:29:13 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x04KTAOH029426 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x04KTA01029425; Fri, 4 Jan 2019 22:29:10 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 4 Jan 2019 22:29:10 +0200 From: Konstantin Belousov To: Fabian Freyer Cc: Christian Barthel , freebsd-jail@freebsd.org, stefan@gronke.net Subject: Re: kqueue(2) kevents for jails Message-ID: <20190104202910.GV2326@kib.kiev.ua> References: <106dc2ec-9b92-6885-ca4c-8422e0aa061c@physik.tu-berlin.de> <87k1jkmja7.fsf@x230.onfire.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 20:29:18 -0000 On Fri, Jan 04, 2019 at 09:11:58PM +0100, Fabian Freyer wrote: > 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? Only one reader is supported, effectively. devctl(4) tries to limit opens naively. But then even if you have the file descriptor and fork or pass it over unix domain socket, single event can be only read by one reader.