From owner-freebsd-hackers@freebsd.org Fri Oct 2 17:35:03 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 E2647A0D32F for ; Fri, 2 Oct 2015 17:35:02 +0000 (UTC) (envelope-from larry.maloney@hackerdojo.com) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) (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 B8BE7110C for ; Fri, 2 Oct 2015 17:35:02 +0000 (UTC) (envelope-from larry.maloney@hackerdojo.com) Received: by pacfv12 with SMTP id fv12so114221643pac.2 for ; Fri, 02 Oct 2015 10:35:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=nBy3+QnXNYgr7PhKs33QY1O3bCuFLZc+2RWpy5o4tQI=; b=ZCDs34K1BMB3LJ9/7H8zc4EBKHf7AWmMk6i0epeqFLKxefWOy6DM0TL+eaks5sAOy2 OLjv0PXkQKSK+QlY1OFWP58nhUIjm/dHDucqeEof/J+zGnvpdjIXOmgo1NeIpNZ7THWl bz4vRRuiVPwn8zvW6h2Jb4M8ukNRNPmDAoIjXLDRRJM1WwiKcfXR58a5BxGKx9C/Rgon DnSJvhBHN3qDHtbfEOKXH5HGAk8jtEe/4F1oRIo6NM3VS6Kv1h/Ov1WWg21CiG2iINTz t3KUyxyCAXawjxcBYgxuJfSSOtizvMuVWjKv4B8+MwXhGG/9EMLaCuR2cCyF2cdVOf+9 Jmmw== X-Gm-Message-State: ALoCoQlaz2XopblR9Dc1Jzayhlp46aHPbU4yBcV0fDAHnIyx/QtLQm+SA6w7uTcIc80OGm0E8DoA X-Received: by 10.66.144.40 with SMTP id sj8mr21573287pab.72.1443807301574; Fri, 02 Oct 2015 10:35:01 -0700 (PDT) Received: from [51.217.126.33] (66-87-118-33.pools.spcsdns.net. [66.87.118.33]) by smtp.gmail.com with ESMTPSA id fm3sm10035846pbb.36.2015.10.02.10.34.59 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 Oct 2015 10:35:00 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: rc(8) parallel tasks From: Larry Maloney X-Mailer: iPhone Mail (13A404) In-Reply-To: <560EADD2.60905@jet9.net> Date: Fri, 2 Oct 2015 10:35:33 -0700 Cc: freebsd-hackers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3B7471C5-16B2-41B0-809F-48BADF037357@hackerdojo.com> References: <560EADD2.60905@jet9.net> To: Cyril Vechera 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: Fri, 02 Oct 2015 17:35:03 -0000 Awesome Sent from my iPhone > On Oct 2, 2015, at 9:16 AM, Cyril Vechera wrote: >=20 > Hi there. >=20 > We've got a small launcher script (~250 loc) for parallel services start/s= top 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 reduct= ion of rc part from 27 to 7 seconds, mostly on eliminating jams for network o= r other long-latency resources waiting. >=20 > The launcher is written in pure POSIX shell and uses FIFOs (named pipes) a= s 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 top= ological order (strict partial order) defined by dependencies. It requires o= nly 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 supp= lied by some kinf of writtable fs, ie tmpfs. The FreeBSD-integrated version u= ses standard rcorder annotations (REQUIRE, BEFORE and PROVIDE) and there's n= o need to change rc.d scripts >=20 > It's not a full init replacement or a kind of services supervision tool. I= t only starts or invokes a group of scripts in parallel with resolving and a= ssuring execution in dependencies order. >=20 > Please take a look at the script and patch set for FreeBSD: >=20 > https://github.com/cvss/jet9-multitask-init/blob/master/jet9-multitask-ini= t > https://github.com/cvss/jet9-multitask-init/tree/master/examples/freebsd >=20 >=20 > --=20 > Cyril Vechera >=20 > _______________________________________________ > 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"=