From owner-dev-commits-src-main@freebsd.org Wed Feb 24 14:15:28 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7BE2E55E811; Wed, 24 Feb 2021 14:15:28 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dlycc0bSfz3K9m; Wed, 24 Feb 2021 14:15:27 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.229.168]) by shaw.ca with ESMTPA id Euwmln4lpnRGtEuwolR8c6; Wed, 24 Feb 2021 07:15:26 -0700 X-Authority-Analysis: v=2.4 cv=cagXElPM c=1 sm=1 tr=0 ts=60365f7e a=7AlCcx2GqMg+lh9P3BclKA==:117 a=7AlCcx2GqMg+lh9P3BclKA==:17 a=xqWC_Br6kY4A:10 a=8nJEP1OIZ-IA:10 a=qa6Q16uM49sA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=w16vAm4-AAAA:8 a=pGLkceISAAAA:8 a=EkcXrb_YAAAA:8 a=f200sBVU4sSyzcJi4CQA:9 a=wPNLvfGTeEIA:10 a=UJ0tAi3fqDAA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=eWus_ag6ds_90y4h1ov8:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id 8A12145C; Wed, 24 Feb 2021 06:15:23 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 11OEFNB2047672; Wed, 24 Feb 2021 06:15:23 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202102241415.11OEFNB2047672@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Baptiste Daroussin cc: Cy Schubert , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot In-reply-to: References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <202102240105.11O15bKn096987@slippy.cwsent.com> <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu> <202102241348.11ODmB3X003509@slippy.cwsent.com> Comments: In-reply-to Baptiste Daroussin message dated "Wed, 24 Feb 2021 13:50:53 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Wed, 24 Feb 2021 06:15:23 -0800 X-CMAE-Envelope: MS4xfPJ9S8Rg9OBjyPs4AsreMzOwPofDWlpZOE6eI9DcKZHQNzGD2soJ/CWurvVFKN8hERu/P5Dpztv4suVDvg7WbMg8ra5io49PdC7zd5NLSAEbf8kEqPm1 c2Q+tFsrCnZJT6yVM0F77QYpZHJdV0CeO6xhgZiC2MdgOR8EdIzmkKNlwviuqZdGUQBHUXo/2zR8AdQvZjPN5b6FhfEK1+xLxmj/A2M8iENcA2UtmqoQM88p fa+9D5cWNLE+oW3nBYxN+k5K+csX+1CDuQy0LTxwhWWRHfw2M/XZAcC7RPv+skZpSliCT/cvAlQtI7CuCS6h9owTottF3jneQ6GNJbmlyhk= X-Rspamd-Queue-Id: 4Dlycc0bSfz3K9m X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2021 14:15:28 -0000 In message , Baptiste Darouss in writes: > > 24 févr. 2021 14:48:29 Cy Schubert : > > > In message <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu>, Baptiste > > Daroussin > > writes: > >> > >> > >> --7stizekjxx47ph24 > >> Content-Type: text/plain; charset=us-ascii > >> Content-Disposition: inline > >> Content-Transfer-Encoding: quoted-printable > >> > >> On Tue, Feb 23, 2021 at 05:05:37PM -0800, Cy Schubert wrote: > >>> In message <202102231027.11NARYYE041280@gitrepo.freebsd.org>, Baptiste=20 > >>> Daroussi > >>> n writes: > >>>> The branch main has been updated by bapt: > >>>> > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D77e1ccbee3ed6c837929e4e2= > >> 32fd07f9 > >>>> 5bfc8294 > >>>> > >>>> commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 > >>>> Author:     Rick Parrish > >>>> AuthorDate: 2021-02-07 06:15:21 +0000 > >>>> Commit:     Baptiste Daroussin > >>>> CommitDate: 2021-02-23 10:16:53 +0000 > >>>> > >>>>     rc: implement parallel boot > >>>>    =20 > >>>>     take advantage of the rcorder -p argument to implement parallel > >>>>     booting in rc. > >>>>    =20 > >>>>     According to the author non scientific tests: > >>>>     on a Core 2 Duo with spinning disk: > >>>>    =20 > >>>>     | Services enabled | before | after | saving | > >>>>     | 0                | 8s     | 8s    | 0   >     | > >>>>     | 1                | 13s    | 13s   | 0    >    | > >>>>     | 2                | 17s    | 13s   | 5    >    | > >>>>     | 3                | 23s    | 13s   | 10   >  Â  | > >>>>     | 4                | 28s    | 13s   | 15   >  Â  | > >>>>     | 5                | 33s    | 13s   | 20   >  Â  | > >>>>    =20 > >>>>     PR:             249192 > >>>>     MFC after:      3 weeks > >>>> --- > >>>> libexec/rc/rc | 49 ++++++++++++++++++++++++++++++++++--------------- > >>>> 1 file changed, 34 insertions(+), 15 deletions(-) > >>>> > >>>> diff --git a/libexec/rc/rc b/libexec/rc/rc > >>>> index 35db4a850516..722d7fe35884 100644 > >>>> --- a/libexec/rc/rc > >>>> +++ b/libexec/rc/rc > >>>> @@ -91,19 +91,31 @@ if ! [ -e ${firstboot_sentinel} ]; then > >>>>   skip_firstboot=3D"-s firstboot" > >>>> fi > >>>> =20 > >>>> +# rc_parallel_start default is "NO" > >>>> +rc_parallel_start=3D${rc_parallel_start:-NO} > >>>> +_rc_parallel=3D'' > >>>> +# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" > >>>> +checkyesno rc_parallel_start && _rc_parallel=3D'-p' > >>>> + > >>>> # Do a first pass to get everything up to $early_late_divider so that > >>>> # we can do a second pass that includes $local_startup directories > >>>> # > >>>> -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` > >>>> +files=3D`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.d/*= > >> 2>/dev/ > >>>> null` > >>>> =20 > >>>> _rc_elem_done=3D' ' > >>>> -for _rc_elem in ${files}; do > >>>> - run_rc_script ${_rc_elem} ${_boot} > >>>> - _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > >>>> - > >>>> - case "$_rc_elem" in > >>>> - */${early_late_divider})  break ;; > >>>> - esac > >>>> +IFS=3D$'\n' > >>>> +for _rc_group in ${files}; do > >>>> + IFS=3D$' ' > >>>> + for _rc_elem in ${_rc_group}; do > >>>> +   run_rc_script ${_rc_elem} ${_boot} & > >>>> +   _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > >>>> + > >>>> +   case "$_rc_elem" in > >>>> +   */${early_late_divider}) break ;; > >>>> +   esac > >>>> + done > >>>> + wait > >>>> + IFS=3D$'\n' > >>>> done > >>>> =20 > >>>> unset files local_rc > >>>> @@ -122,14 +134,21 @@ if [ -e ${firstboot_sentinel} ]; then > >>>>   skip_firstboot=3D"" > >>>> fi > >>>> =20 > >>>> -files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} 2>/= > >> dev/null > >>>> ` > >>>> -for _rc_elem in ${files}; do > >>>> - case "$_rc_elem_done" in > >>>> - *" $_rc_elem "*)  continue ;; > >>>> - esac > >>>> - > >>>> - run_rc_script ${_rc_elem} ${_boot} > >>>> +files=3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} ${_= > >> rc_paral > >>>> lel} 2>/dev/null` > >>>> +IFS=3D$'\n' > >>>> +for _rc_group in ${files}; do > >>>> + IFS=3D$' ' > >>>> + for _rc_elem in ${_rc_group}; do > >>>> +   case "$_rc_elem_done" in > >>>> +   *" $_rc_elem "*) continue ;; > >>>> +   esac > >>>> + > >>>> +   run_rc_script ${_rc_elem} ${_boot} & > >>>> + done > >>>> + wait > >>>> + IFS=3D$'\n' > >>>> done > >>>> +unset IFS > >>>> =20 > >>>> # Remove the firstboot sentinel, and reboot if it was requested. > >>>> # Be a bit paranoid about removing it to handle the common failure > >>>> > >>> =20 > >>> Since this commit my postfix, dovecot and nut fail to start at boot, and= > >> =20 > >>> must be started by hand. > >>> =20 > >>> =20 > >> I cannot reproduce, what failure do you have?=20 > > > > It was a missing unset IFS and it's been fixed. > > > > > > > > Thank you for the fix and sorry about that! No problem. IFS is easy to miss. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few.