From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 20 22:23:56 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29FCD106564A for ; Wed, 20 Jun 2012 22:23:56 +0000 (UTC) (envelope-from gmx@ross.cx) Received: from www81.your-server.de (www81.your-server.de [213.133.104.81]) by mx1.freebsd.org (Postfix) with ESMTP id C96698FC15 for ; Wed, 20 Jun 2012 22:23:55 +0000 (UTC) Received: from [92.76.95.179] (helo=michael-think) by www81.your-server.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.74) (envelope-from ) id 1ShTJa-0007KN-8b; Thu, 21 Jun 2012 00:23:54 +0200 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Daniel Robbins" , "Freddie Cash" References: <4FDF6177.5050608@unsane.co.uk> <4FDFB166.2040709@FreeBSD.org> <4FDFB44D.9090308@gentoo.org> <4FE0ADCD.9010109@FreeBSD.org> <4FE0C123.8030301@gentoo.org> <4FE0F773.1080403@gentoo.org> <4FE100F9.2050009@funtoo.org> <20120620073920.GA5300@lonesome.com> Date: Thu, 21 Jun 2012 00:23:47 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Michael Ross" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.00 (Win32) X-Authenticated-Sender: gmx@ross.cx X-Virus-Scanned: Clear (ClamAV 0.97.3/15064/Wed Jun 20 21:03:45 2012) X-Mailman-Approved-At: Thu, 21 Jun 2012 01:13:17 +0000 Cc: Wojciech Puchar , "freebsd-hackers@freebsd.org" Subject: Re: Replacing rc(8) (Was: FreeBSD Boot Times) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 22:23:56 -0000 Am 20.06.2012, 23:42 Uhr, schrieb Freddie Cash : > On Wed, Jun 20, 2012 at 1:28 PM, Daniel Robbins > wrote: >> On Wed, Jun 20, 2012 at 2:22 PM, Daniel Robbins >> wrote: >>> >>> This doesn't change the "hard" runlevel (3) but it changes the OpenRC >>> logical runlevel. Basically, this convenient system is compatible with >>> traditional linux numerical runlevels but does depend on them. >>> >> >> Meant to type: "does NOT depend on them". >> >> Here is a bit more info: >> >> Runlevel-specific conf.d files: >> >> http://www.funtoo.org/wiki/Funtoo_Linux_Networking#Alternate_Configs >> >> Stacked runlevels (this is a more sophisticated feature than just >> creating a duplicate, separately-managed runlevel): >> >> http://www.funtoo.org/wiki/Stacked_Runlevels >> >> To create a separately-managed runlevel, you would just: >> >> # mkdir /etc/runlevels/maintenance >> # rc-update add maintenance svc1 >> # rc-update add maintenance svc2 >> # rc-update add maintenance svc1 >> >> You could then switch by typing: >> >> # rc maintenance >> >> Anything not in the maintenance runlevel that is currently running >> would be stopped, and any new services in maintenance that are not >> running would be started. > > There's no need to do a wholesale replacement of the RC system in > FreeBSD to support this concept. What you are describing are "service > profiles". And we already have a single file that describes the > default "service profile" for FreeBSD: /etc/rc.conf. That lists > every service that should be started (or stopped). > > All that's missing is a way to tell the RC system to use a different > rc.conf file (like rc.conf.mobile, or rc.conf.wireless or > rc.conf.whatever), and to run through the RC setup based on that file. ... and to be able to switch between two configurations at runtime, without taking down services listed active in both configurations preferably. > Our current RC system does everything needed except: > - parallel execution of items that don't depend on each other > - monitor running services and restart them if they crash > > Compared to all the init/RC systems on Linux, ours has *many* > advantages, not the least of which are: > - very simple text configuration file > - only 2 directories of init scripts to worry about (/etc/rc.d; > /usr/local/etc/rc.d) > - ability to create "generic" or global config file (/etc/rc.conf) > with local overrides (/etc/rc.conf.local) > - ability to see the exact order that things will start (or stop) via > rcorder > - everything is written in nice, simple, sh > > We don't need to replace a perfectly working system. Maybe it needs > improving, but it doesn't need replacing. > Yes. I don't even think it *needs* improving, but "service profiles" including "network profiles" would be really nice and worth looking into. If we can get that without loosing the simple text-file-based configuration, the better.