Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jun 2012 12:54:55 +0100
From:      RW <rwmaillists@googlemail.com>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Replacing rc(8) (Was: FreeBSD Boot Times)
Message-ID:  <20120619125455.7f19d484@gumby.homeunix.com>
In-Reply-To: <4FE0086F.4000507@gentoo.org>
References:  <20120615124849.GI96212@ass.kameli.org> <CAKYr3zxSOFOUghqao=3U_8sBNHwqce8AGK6mSFd6is11qzjS8w@mail.gmail.com> <20120618081140.GK96212@ass.kameli.org> <4FDF6177.5050608@unsane.co.uk> <4FDF6586.9060501@gentoo.org> <4FDFB166.2040709@FreeBSD.org> <alpine.BSF.2.00.1206190636100.1823@wojtek.tensor.gdynia.pl> <4FE0086F.4000507@gentoo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 19 Jun 2012 01:04:47 -0400
Richard Yao wrote:

> On 06/19/2012 12:39 AM, Wojciech Puchar wrote:
> > - delay at rc.d scripts - there are some delays inserted.
> > 
> >> The latter item is the only place where making changes to rc.d is
> >> going to help, and only then by parellelizing, and even then you
> >> are not really going to gain much since most things at boot time
> >> are serial.
> > 
> > grep sleep /etc/rc.d/* usr/local/etc/rc.d/*
> > 
> >>
> >> So while talk of how to get your favorite boot-time manager into
> >> FreeBSD may be entertaining, it's not likely to be productive, and
> >> almost
> > 
> > it is unimportant as FreeBSD don't crash.
> 
> OpenRC init scripts lack such delays. They store dependency
> information, which enables OpenRC to start them as soon as their
> dependencies are ready.

That's not the reason for the sleeps. FreeBSD sorts the scripts into
dependency order and runs them sequentially, so there's no reason
to sleep waiting for a dependency script to complete. The sleeps
exist for a variety of reasons. 

Just looking at the grep can be a bit misleading. Not all of the
scripts are going to be used, the sleep is not always relevant to
startup, in some case it's in a code path that's not typically taken.

One thing that I think could be easily improved is that the polling
delays could be changed from  1 second to 0.1 seconds. If there's a
reason for rc scipts needing to be portable, there could be a polling
delay function with a "fast polling" option in defaults/rc.conf.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120619125455.7f19d484>