From owner-freebsd-rc@freebsd.org Fri Oct 16 16:06:03 2015 Return-Path: Delivered-To: freebsd-rc@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 71E4CA165A7 for ; Fri, 16 Oct 2015 16:06:03 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (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 487E31AB3 for ; Fri, 16 Oct 2015 16:06:03 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 85DF42088A for ; Fri, 16 Oct 2015 12:06:01 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute1.internal (MEProxy); Fri, 16 Oct 2015 12:06:01 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=dN7Kioy9eGQNt1l Bcysa4IkU8gY=; b=AJ6IUm/jOoxPYlVzVRMRB0Xw7nihtXOe9WCR79BnYoqXis4 AqX+T19bnmMWBuYNiBu1pMIpWnRxxhRtUDVeoAmrtCDu096LUf7atVaLdHiYhp9b qrr38d6EQRTxn5q5UML92AN9WV2VdGAOjI9tmeXoofATIjyx34n6ptg66hEs= Received: by web3.nyi.internal (Postfix, from userid 99) id 4BDBF11101C; Fri, 16 Oct 2015 12:06:01 -0400 (EDT) Message-Id: <1445011561.1233840.412174489.688C5822@webmail.messagingengine.com> X-Sasl-Enc: dSD1SdLLWDCvnSxW39Tluk1pP1Ns4PS3dhY9QYBkJwr9 1445011561 From: Mark Felder To: Cyril Vechera , dougb@FreeBSD.org, freebsd-hackers@freebsd.org, freebsd-rc@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface - ajax-25d3ec43 Subject: Re: rc(8) parallel tasks Date: Fri, 16 Oct 2015 11:06:01 -0500 In-Reply-To: <560EAC05.6050308@jet9.net> References: <560EAC05.6050308@jet9.net> X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Oct 2015 16:06:03 -0000 On Fri, Oct 2, 2015, at 11:08, Cyril Vechera wrote: > Hi there. > > We've got a small launcher script (~250 loc) for parallel services > start/stop etc. It is used on our embedded systems and our users > containers. And I've done a proof of concept for implanting it to the > FreeBSD's standard /etc/rc for execution starting scripts in parallel. > It gave me a boot time reduction of rc part from 27 to 7 seconds, mostly > on eliminating jams for network or other long-latency resources waiting. > > The launcher is written in pure POSIX shell and uses FIFOs (named pipes) > as a mutexes for synchronization. So it is embedded into /etc/rc and > /etc/rc.d preserving rc.subr preloading. As a primary requirement, it > guarantees topological order (strict partial order) defined by > dependencies. It requires only POSIX shell, FreeBSD or Linux kernel, > mkfifo and a writeable file system. Due to last requirement, it can be > run on the late stage or should be supplied by some kinf of writtable > fs, ie tmpfs. The FreeBSD-integrated version uses standard rcorder > annotations (REQUIRE, BEFORE and PROVIDE) and there's no need to change > rc.d scripts > > It's not a full init replacement or a kind of services supervision tool. > It only starts or invokes a group of scripts in parallel with resolving > and assuring execution in dependencies order. > > Please take a look at the script and patch set for FreeBSD: > > https://github.com/cvss/jet9-multitask-init/blob/master/jet9-multitask-init > https://github.com/cvss/jet9-multitask-init/tree/master/examples/freebsd > > Your first link is a 404, but this looks really nice! -- Mark Felder ports-secteam member feld@FreeBSD.org