From owner-freebsd-hackers@freebsd.org Wed Nov 18 07:32:28 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2D6EA321E8 for ; Wed, 18 Nov 2015 07:32:28 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49B40130C for ; Wed, 18 Nov 2015 07:32:28 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: by wmvv187 with SMTP id v187so263842342wmv.1 for ; Tue, 17 Nov 2015 23:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CYlGzTjW8yDKOAY3TQdzjAs2IVjsqw+mYMvzKsn+qrw=; b=okLH4AnbYMzCWoRczV96e9UeCDpX/HT/H7AiIyUclzYCA8t9Z8yQ3qZjqBX4cyGnlG NYZKF2jwYib2N9STPFwfjQXeNK3bi9z8h3mxs0gZhpcxlqR9yHm2RPuoaUT4DImrhkES ZQ2G6KKcNv0iXGcDw8nK9ewYahdCtVq+IbmDS8nEHrRQS5ULBs4ahavqvBNMD7zQ5dTS QrbAEVqSBlnH3ef7ZJf55mJCecUpY45w8is6Fc3mRy+ePUp0k+QwYKoZFeAbusFlGsLU 6M5fnlz8/s0cdlbSkqc5d7cK/cM1ccj7iFIYfnWtzj6RZHGv+UveZfbiHzHaNWr/AjJO rEvw== MIME-Version: 1.0 X-Received: by 10.194.202.163 with SMTP id kj3mr39749wjc.93.1447831946841; Tue, 17 Nov 2015 23:32:26 -0800 (PST) Received: by 10.27.186.138 with HTTP; Tue, 17 Nov 2015 23:32:26 -0800 (PST) In-Reply-To: References: Date: Wed, 18 Nov 2015 08:32:26 +0100 Message-ID: Subject: Re: relaunchd: a portable clone of launchd From: =?UTF-8?Q?Fernando_Apestegu=C3=ADa?= To: Mark Heily Cc: Benno Rice , FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2015 07:32:28 -0000 On Wed, Nov 18, 2015 at 4:27 AM, Mark Heily wrote: > On Mon, Nov 16, 2015 at 10:32 PM, Benno Rice wrote: >> Hi Mark! >> >> Are you also looking at constructing equivalents to things like notifyd, configd and asld? > > I've written something which blends some of the concepts behind > notifyd and configd. It's called "stated" (state dee) and it's > available here: > > https://github.com/mheily/stated > > I also submitted it to the ports tree here: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204172 > > In a nutshell, it is a generic publish/subscribe mechanism for > programs running on a single host to share information about their > internal state and receive notifications about interesting events. I > was inspired to write it by listening to Jordan Hubbard's talk about > the problems that notifyd was trying to solve, such as programs that > constantly call stat(2) on /etc/localtime to see if someone changed > the timezone out from under them. > > I haven't written any of this yet, but I'm hoping that stated will > present a unified view of all the important OS configuration > settings, so that programs can subscribe to the ones they care about > and get notified when they change. For example, similar to how people > can run "sysctl -a" to see all kernel tunables, I'd like to be able to > run "statectl -a" and get back some JSON like this: > > { > hostname: "myhost", > hostid: "e38a248b-8da1-11e5-b5da-382c4abedb0b", > sshd.enable: "true", > network.defaultrouter: "192.168.0.1", > time.zone: "America/New_York", > dns.fqdn: "myhost.example.com", > dns.domain: "example.com", > dns.nameservers: ["8.8.8.8", "8.8.4.4"], > } > > Then, if a program cares deeply about using the most up-to-date > timezone setting, it can subscribe to notifications about changes in > the time.zone key, instead of constantly polling for changes to > /etc/localtime. > > Notice that the above JSON isn't specific to FreeBSD, so programs > don't need to care about operating-system details like what file in > /etc is used to define the hostname. On Linux, it can be > /etc/hostname; on BSD it can be /etc/rc.conf; instead, all they need > to know is that the current value of the hostname is stored in a key > called "hostname" > >> >> What are you using as your comms/RPC framework, if anything? >> > > Nothing yet, but I'm thinking of using D-Bus as the RPC mechanism for > relaunchd, since a lot of open source programs are already using > D-Bus. Including systemd ;) which exposes several interfaces to DBus. If this is intended to be in base at some point of the future, it shouldn't rely on third party software from ports. Anyway, I agree that if we are going to replace a key component of the system we may want to discuss which approach is best (launchd, relaunchd, OpenRC, svc, etc...). Cheers. > >> >>> On Nov 15, 2015, at 18:55, Mark Heily wrote: >>> >>> I've written a clone of the launchd framework found in Mac OS X [1]. >>> It's called "relaunchd" and I would like to some help improving it and >>> getting it added to the FreeBSD ports tree [2]. >>> >>> Here's the source code: >>> >>> https://github.com/mheily/relaunchd >>> >>> One of the coolest things I've been able to do with it is to use >>> socket activation to launch an unmodified version of Apache inside of >>> a jail, pass it a socket descriptor bound to port 80 from the primary >>> network interface outside of the jail, and have it "just work" and >>> start serving web content using the pre-existing socket descriptor. >>> This eliminates the need to setup a cumbersome NAT and port forwarding >>> mechanism for each jail [3]. >>> >>> This is a completely separate line of development from the work that >>> the NextBSD folks are doing to port the published Apple source code >>> for launchd and all of it's dependencies. >>> >>> I'd be happy to answer questions about relaunchd, and welcome >>> contributions from anyone who wants to help make launchd on FreeBSD a >>> reality. >>> >>> Regards, >>> >>> - Mark >>> >>> [1] https://en.wikipedia.org/wiki/Launchd >>> [2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204240 >>> [3] Example: http://kbeezie.com/freebsd-jail-single-ip/ >>> _______________________________________________ >>> freebsd-hackers@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >> > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"