From owner-freebsd-hackers@freebsd.org Tue Mar 6 15:47:35 2018 Return-Path: Delivered-To: freebsd-hackers@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 66E9FF3C726 for ; Tue, 6 Mar 2018 15:47:35 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from mail.rlwinm.de (mail.rlwinm.de [138.201.35.217]) (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 EDBE67C4E3 for ; Tue, 6 Mar 2018 15:47:34 +0000 (UTC) (envelope-from crest@rlwinm.de) Received: from crest.bultmann.eu (unknown [IPv6:2a00:c380:c0d5:1:35d5:38fc:d387:8188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rlwinm.de (Postfix) with ESMTPSA id EF58714AF1; Tue, 6 Mar 2018 15:47:26 +0000 (UTC) Subject: Re: S6-init was: OpenRC 0.35 for FreeBSD To: Mark Saad Cc: freebsd-hackers@freebsd.org References: <20180302083756.GH34685@e.0x20.net> <35AC3784-D02B-4EB1-9F82-E522B7A7730E@FreeBSD.org> <0120B9B9-74CA-47CF-8890-574AB3DC8115@longcount.org> From: Jan Bramkamp Message-ID: Date: Tue, 6 Mar 2018 16:47:24 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <0120B9B9-74CA-47CF-8890-574AB3DC8115@longcount.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2018 15:47:35 -0000 On 06.03.18 15:16, Mark Saad wrote: > > >> On Mar 6, 2018, at 7:34 AM, Jan Bramkamp wrote: >> >>> On 02.03.18 17:11, Jonathan Anderson wrote: >>>> On 2 Mar 2018, at 12:13, Jonathan Anderson wrote: >>>> >>>> [...] there are a number of options that I've heard of vying for consideration: >>>> >>>> - finit >>>> - jobd (is this still a thing?) >>>> - nosh >>>> - OpenRC >>>> - runit >>> Oh, and also s6: https://skarnet.org/software/s6/why.html >> >> I've run s6 + s6-rc as init replacement for FreeBSD 11.1 on my laptop for over a year. The init_path kenv simplifies testing alternative init systems a lot. It works really well and required only minimal porting. > > Jan > I am interested to know more ; do you have any notes ? Also did you ever try runit? Again it’s another similar project but if I remember it’s in ports . I used runit as init replacement on my previous laptop, but found it limitations to annoying. Runit is a pure process supervisor. The only state runit tracks are supervised processes and there are is no support for dependencies. And while it supports readiness checks those are implemented by polling every 100ms. The only way to track state with runit is to wrap it with a sleeping process. I'm still using runit on my servers. On those I have start runsv from a rc.d script. This runsv provides a default log replacing readproctile style hacks and spawns the runsvdir. The result looks like this: daemon---runsv-+-runsvdir-+-runsv-+-rspamd-1.6.6---35*[rspamd-1.6.6] | | `-svlogd | |-runsv-+-socklog | | `-svlogd | |-runsv-+-dovecot-+-anvil | | | |-auth | | | |-config | | | `-log | | `-svlogd | |-2*[runsv] | |-runsv---master-+-anvil | | |-cleanup | | |-7*[dnsblog] | | |-2*[lmtp] | | |-2*[local] | | |-pickup | | |-postscreen | | |-qmgr | | |-smtpd | | |-tlsmgr | | `-trivial-rewrite | |-runsv-+-sshd---sshd---sshd---zsh-+-cat | | | `-dtpstree | | `-svlogd | |-runsv-+-redis-server | | `-svlogd | |-runsv-+-nginx---nginx | | `-svlogd | `-runsv---spiped `-svlogd Runit is a fine process supervisor, but the development ended years ago with a "finished" product. The author decided that process supervision is enough and didn't try to write the missing service manager on top of runit. An other downside of runit compared to s6 is that it uses polling instead of proper readiness notification. If you have questions regarding s6 or s6-rc there are the #s6 (and #s6-offtopic) IRC channels on freenode and the skarware mailing lists (http://skarnet.org/lists.html#skaware). I did keep notes. I just didn't publish them because they are nothing more than an unstructured brain dump. I'm happy to answer any questions.