Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jun 2003 00:59:18 -0700
From:      David Schultz <das@FreeBSD.ORG>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        arch@FreeBSD.ORG
Subject:   Re: Making a dynamically-linked root
Message-ID:  <20030604075918.GA8419@HAL9000.homeunix.com>
In-Reply-To: <3EDD7CFA.4795FB99@mindspring.com>
References:  <20030602171942.GA87863@roark.gnf.org> <xzpznl02nry.fsf@flood.ping.uio.no> <20030603080456.GA57773@cirb503493.alcatel.com.au> <3EDD7CFA.4795FB99@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jun 03, 2003, Terry Lambert wrote:
> The main problem we ran into with doing this on the InterJet
> was thatsome services started later would finish starting
> before earlier services on which they were dependent.

You can solve this problem by enforcing the rule that when a
service forks off a daemon process, the parent does not exit
until the child is ready to accept requests.  I think Oracle
and Postgresql work like this.  Alternatively, as with named,
you perform all necessary initialization and opening of sockets
before forking at all.

There may be some services that don't offer this level of sanity,
but these services can probably be fixed without too much effort.
In the worst case, you will need a wrapper to poll the daemon
until it is running normally.

Once all of your services' startup scripts can make this
guarantee, writing a program to do parallel boot is easy.  You
continuously try to start as many ``exposed'' nodes in your
dependency graph at a time as you can (up to some concurrency
limit), where an exposed node is a node whose ancestors have all
finished starting.  (Wasn't this mentioned in NetBSD's original
rcNG proposal?)

> On top of that, the
> dependencies tend to be both hard and soft, e.g. it's possible
> to continue to offer a degraded service, rather than failing
> outright, if some dependent services aren't there (e.g. you
> can log by IP address if DNS isn't up to provide reverse
> name mappings to look pretty in your logs, etc.).

Distinctions like this are particularly important if you would
like to make use of the information about dependencies between
processes for more than just parallel boot.  Consider how you
could get your server to automatically recover if named dies
versus if your database dies.



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