From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 20 21:42:50 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EFF2106564A for ; Wed, 20 Jun 2012 21:42:50 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id E94458FC21 for ; Wed, 20 Jun 2012 21:42:49 +0000 (UTC) Received: by qcsg15 with SMTP id g15so5456232qcs.13 for ; Wed, 20 Jun 2012 14:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CyIF95rdEFheKsP1B/XC7ATYVgUkZmiCo3+oBOxn1zA=; b=a3jRXYtJT2OAE14SWdlNhxWk+S5OaInus48H6IRHXyh+Fif2ReDX3hfNaI+3j2EnvM DqaXIj21Y3gZ9ejaIDKOQ3kXmMEjyOLBN81hFdRuTrM1wafcbSPqI7/DfDLLwKznrwGB JL7BhPWTKn7x5zwcymLPTfrRhOqGKJy4034vX0LAHT2iJ4wMSmCYw6zr0tGP+/h2uuur skwhmGXvPDO+c7ulawBINsWJewj0ZcRWfErg/3uFX+0Y2mQGxOvqpCb9reh3/cfCWcCG QGp5McCB9Ps3QX8IWWtlCOXuRY8gG9O8wD+dmjZ6EOKdxEI89YGjbLDgFo2x3kyelLzD Td9A== MIME-Version: 1.0 Received: by 10.224.204.197 with SMTP id fn5mr387731qab.65.1340228569401; Wed, 20 Jun 2012 14:42:49 -0700 (PDT) Received: by 10.229.192.68 with HTTP; Wed, 20 Jun 2012 14:42:49 -0700 (PDT) In-Reply-To: References: <4FDF6177.5050608@unsane.co.uk> <4FDF6586.9060501@gentoo.org> <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: Wed, 20 Jun 2012 14:42:49 -0700 Message-ID: From: Freddie Cash To: Daniel Robbins Content-Type: text/plain; charset=UTF-8 Cc: Michael Ross , "freebsd-hackers@freebsd.org" , Wojciech Puchar 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 21:42:50 -0000 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. 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. -- Freddie Cash fjwcash@gmail.com