From owner-dev-commits-src-main@freebsd.org Wed Feb 24 13:51:00 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 9895355DC41; Wed, 24 Feb 2021 13:51:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dly4N3sB9z3HY2; Wed, 24 Feb 2021 13:51:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from aniel.nours.eu (ns393929.ip-176-31-115.eu [176.31.115.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 3F6F0A847; Wed, 24 Feb 2021 13:51:00 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from [127.0.0.1] (10.246.39.62.rev.sfr.net [62.39.246.10]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aniel.nours.eu (Postfix) with ESMTPSA id 78BD13383A; Wed, 24 Feb 2021 14:50:57 +0100 (CET) Date: Wed, 24 Feb 2021 13:50:53 +0000 (UTC) From: Baptiste Daroussin To: Cy Schubert Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: In-Reply-To: <202102241348.11ODmB3X003509@slippy.cwsent.com> References: <202102231027.11NARYYE041280@gitrepo.freebsd.org> <202102240105.11O15bKn096987@slippy.cwsent.com> <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu> <202102241348.11ODmB3X003509@slippy.cwsent.com> Subject: Re: git: 77e1ccbee3ed - main - rc: implement parallel boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Correlation-ID: 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 13:51:00 -0000 24 f=C3=A9vr. 2021 14:48:29 Cy Schubert : > In message <20210224092047.qjazicrzfvnf4vb2@aniel.nours.eu>, Baptiste > Daroussin > writes: >> >> >> --7stizekjxx47ph24 >> Content-Type: text/plain; charset=3Dus-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= =3D20 >>> Daroussi >>> n writes: >>>> The branch main has been updated by bapt: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D3D77e1ccbee3ed6c837929e= 4e2=3D >> 32fd07f9 >>>> 5bfc8294 >>>> >>>> commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 >>>> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Rick Parrish >>>> AuthorDate: 2021-02-07 06:15:21 +0000 >>>> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Baptiste Daroussin >>>> CommitDate: 2021-02-23 10:16:53 +0000 >>>> >>>> =C2=A0=C2=A0=C2=A0 rc: implement parallel boot >>>> =C2=A0=C2=A0 =3D20 >>>> =C2=A0=C2=A0=C2=A0 take advantage of the rcorder -p argument to implem= ent parallel >>>> =C2=A0=C2=A0=C2=A0 booting in rc. >>>> =C2=A0=C2=A0 =3D20 >>>> =C2=A0=C2=A0=C2=A0 According to the author non scientific tests: >>>> =C2=A0=C2=A0=C2=A0 on a Core 2 Duo with spinning disk: >>>> =C2=A0=C2=A0 =3D20 >>>> =C2=A0=C2=A0=C2=A0 | Services enabled | before | after | saving | >>>> =C2=A0=C2=A0=C2=A0 | 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 8s=C2=A0=C2=A0=C2=A0=C2=A0 | 8= s=C2=A0=C2=A0=C2=A0 | 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 1=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 13s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 2=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 17s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 5=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 3=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 23s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 10=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 4=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 28s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 15=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0=C2=A0 | 5=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 33s=C2=A0=C2=A0=C2=A0 | 13s=C2= =A0=C2=A0 | 20=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> =C2=A0=C2=A0 =3D20 >>>> =C2=A0=C2=A0=C2=A0 PR:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 249192 >>>> =C2=A0=C2=A0=C2=A0 MFC after:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 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 >>>> =C2=A0 skip_firstboot=3D3D"-s firstboot" >>>> fi >>>> =3D20 >>>> +# rc_parallel_start default is "NO" >>>> +rc_parallel_start=3D3D${rc_parallel_start:-NO} >>>> +_rc_parallel=3D3D'' >>>> +# enable rcorder -p if /etc/rc.conf rc_parallel_start is "YES" >>>> +checkyesno rc_parallel_start && _rc_parallel=3D3D'-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=3D3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* 2>/dev/null` >>>> +files=3D3D`rcorder ${skip} ${skip_firstboot} ${_rc_parallel} /etc/rc.= d/*=3D >> 2>/dev/ >>>> null` >>>> =3D20 >>>> _rc_elem_done=3D3D' ' >>>> -for _rc_elem in ${files}; do >>>> - run_rc_script ${_rc_elem} ${_boot} >>>> - _rc_elem_done=3D3D"${_rc_elem_done}${_rc_elem} " >>>> - >>>> - case "$_rc_elem" in >>>> - */${early_late_divider})=C2=A0 break ;; >>>> - esac >>>> +IFS=3D3D$'\n' >>>> +for _rc_group in ${files}; do >>>> + IFS=3D3D$' ' >>>> + for _rc_elem in ${_rc_group}; do >>>> +=C2=A0=C2=A0 run_rc_script ${_rc_elem} ${_boot} & >>>> +=C2=A0=C2=A0 _rc_elem_done=3D3D"${_rc_elem_done}${_rc_elem} " >>>> + >>>> +=C2=A0=C2=A0 case "$_rc_elem" in >>>> +=C2=A0=C2=A0 */${early_late_divider}) break ;; >>>> +=C2=A0=C2=A0 esac >>>> + done >>>> + wait >>>> + IFS=3D3D$'\n' >>>> done >>>> =3D20 >>>> unset files local_rc >>>> @@ -122,14 +134,21 @@ if [ -e ${firstboot_sentinel} ]; then >>>> =C2=A0 skip_firstboot=3D3D"" >>>> fi >>>> =3D20 >>>> -files=3D3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} = 2>/=3D >> dev/null >>>> ` >>>> -for _rc_elem in ${files}; do >>>> - case "$_rc_elem_done" in >>>> - *" $_rc_elem "*)=C2=A0 continue ;; >>>> - esac >>>> - >>>> - run_rc_script ${_rc_elem} ${_boot} >>>> +files=3D3D`rcorder ${skip} ${skip_firstboot} /etc/rc.d/* ${local_rc} = ${_=3D >> rc_paral >>>> lel} 2>/dev/null` >>>> +IFS=3D3D$'\n' >>>> +for _rc_group in ${files}; do >>>> + IFS=3D3D$' ' >>>> + for _rc_elem in ${_rc_group}; do >>>> +=C2=A0=C2=A0 case "$_rc_elem_done" in >>>> +=C2=A0=C2=A0 *" $_rc_elem "*) continue ;; >>>> +=C2=A0=C2=A0 esac >>>> + >>>> +=C2=A0=C2=A0 run_rc_script ${_rc_elem} ${_boot} & >>>> + done >>>> + wait >>>> + IFS=3D3D$'\n' >>>> done >>>> +unset IFS >>>> =3D20 >>>> # Remove the firstboot sentinel, and reboot if it was requested. >>>> # Be a bit paranoid about removing it to handle the common failure >>>> >>> =3D20 >>> Since this commit my postfix, dovecot and nut fail to start at boot, an= d=3D >> =3D20 >>> must be started by hand. >>> =3D20 >>> =3D20 >> I cannot reproduce, what failure do you have?=3D20 > > It was a missing unset IFS and it's been fixed. > > Thank you for the fix and sorry about that! Bapt