From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 21 17:45:52 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 0C288106564A for ; Thu, 21 Jun 2012 17:45:52 +0000 (UTC) (envelope-from mwm@mired.org) Received: from mail-gg0-f182.google.com (mail-gg0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9ECB18FC12 for ; Thu, 21 Jun 2012 17:45:51 +0000 (UTC) Received: by ggnm2 with SMTP id m2so862418ggn.13 for ; Thu, 21 Jun 2012 10:45:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:organization :x-mailer:face:mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=1D2B4TuS9z23e5vDpKgtJbq6JE7hHK46Oh10LR68vUA=; b=jInQMB8e0Kk5bprtVHcX6A7BTMt3hNT66kJjsv6H0yepvfN6qlcPKLcWv6QbYYdso7 0HMfatvIYgm1hvQ+ukxqgJWKYCA+x2bMgD855R+9Qkdb6iy8BOj58ixU1Vxwt77tk3qf wADIrcUvOT/tI9wW6bLi13PTD2XssWf+cq3EEWG3DoUCx0DhvrnmXHIIA9hHZ0LIASn4 9Pig0IdBymGHnnL4jXi6FLZjtVhQbKsRuiT7LPxvs/w0KVRxkAAhnZ+fkmgC6fB2hGYj WrPivgW3itBKV4w2gF9uzwi0Lj7ZSZNjo4TRdRbg/lB6jqSnTA3fcu8w7nU26Gxih5Qe JHMg== Received: by 10.50.190.163 with SMTP id gr3mr8545656igc.22.1340300750450; Thu, 21 Jun 2012 10:45:50 -0700 (PDT) Received: from bhuda.mired.org (74-140-201-117.dhcp.insightbb.com. [74.140.201.117]) by mx.google.com with ESMTPS id rd8sm34187908igb.3.2012.06.21.10.45.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Jun 2012 10:45:50 -0700 (PDT) Date: Thu, 21 Jun 2012 13:45:45 -0400 From: Mike Meyer To: "freebsd-hackers@freebsd.org" Message-ID: <20120621134545.5e42b50e@bhuda.mired.org> In-Reply-To: References: <4FDFB44D.9090308@gentoo.org> <4FE0ADCD.9010109@FreeBSD.org> <4FE0C123.8030301@gentoo.org> <4FE0F773.1080403@gentoo.org> <4FE100F9.2050009@funtoo.org> <20120620073920.GA5300@lonesome.com> <20120620214006.GA1651@aspire.rulingia.com> Organization: Meyer Consulting X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd8.3) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEXguIzRkGnhyaz069mXhW0WHRnbrnR9WCQ6LB0CchNMAAACSUlEQVQ4jV2TQW7jMAxFGaPQOgQEdZaGMsgBrAvUA03dCxj1Uu4U2gfwQD7AGNax51NK07RcxXz6/CSl0Ij450vkPG1jzpIZM1UwDCl/xB14TWnNX8A00Qj5a0mnVFVbVUz4MeErea2HikSRqZzY894zwg9p2+/AtO8LzxFED+tNAUFeU29iFOLRxlZAcdo9A8wi8ZBMV4BKPde82Oxrvs6BTkulQIClte0DLFzzsKk9j1MBex8iUaP00Bd78S/muyFScrTXz6zLkEUxJp+SabQfNOs4f4Jpx5qSZ/304PWwlEWP1cOn/mJQR7EOD+uKhjcBLziuL7xoY5Xm+VFAUSw/LwwwsHEHxihpwV4EJH0xXRkbw1PkRw+X4pEuSJwBggqk+HEYKkiL5/74/nQkogigzQsAFrakxZyfw3wMIEEZPv4AWMfxwqE5GNxGaERjmH+PG8AE0L4/w9g0lsp1raLYAN5azQa+AOoO9NwcpFkTrG2VKNMNEL5UKUUAw34tha0z7onUG0oBoNtczE04GwFE3wCHc0ChezAJ6A1WMV81AtY7wDAJSlXwV+4cwBvsOsrQMRawfQEBz0deEZ7WNpV2szckIKo5VpDHDSDvF1GItwqqAlG01Hh50BGtVhuUkjkasg/14bYFGCgWg1fSWHvmOoJck2xdp9ZvZBHzDVTzX23TkrOn7qe5U2COEw5D4Vx3qEQpFY2Z/3QFnJxzp7YCmSMG19nOUoe869zZfOQb5ywQuWu0yCn5+8gxZz+BE7vG3j4/wbf4D/sXN9Wug1s7AAAAAElFTkSuQmCC Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmDp82q5Z6/x/tYA4GULYR+mD2B1TviL2vfwhVhzlH9weN5z1GFxuxoyjXoJaLegvpkH+mm 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: Thu, 21 Jun 2012 17:45:52 -0000 On Thu, 21 Jun 2012 12:22:08 +0200 (CEST) Wojciech Puchar wrote: > Lets make a summary. > > What functionality would be good to have in FreeBSD that doesn't exist: > > 1) "runlevels" with arbitrary names. runlevel change would start and stop > right services. With a couple of additions: - it should be easy to see which services are on at a given runlevel. - it should be easy to see which runlevels a service is on at. > 2) exploit startup parallelism. > > > What we do not want to change: > > - file structure which is simple. one file in rc.d/ per service and one > global config file (rc.conf) > - anything else that would make things more complicated. > > > As for > > 1) i propose in rc.conf an option to put "NO", "YES" (or ALL) or runlevel > list for each service or runlevel exclusion list for service. > > > examples: > > service1_enable="YES" > service2_enable="NO" > service3_enable="foolevel maintenance" > service4_enable="YES -foolevel" (or ALL -funkyrunlevel) Using two symbols to indicate negation - one to start, and then one on each runlevel - is overkill. There's not a use case where you have a keyword YES or ALL and then runlevels that you start. Personally, I'd restrict YES/NO/ALL to being single symbols, and use "NOT runlevels" to mean "All but these". A bare "NOT" should get the same treatment as a YES/NO/ALL with text after it. > name of default runlevel may be "full" or "multiuser" > > service 1 will always work, service 2 never, service 3 only at runlevels > "foolevel" and "maintenance", service4 with any runlevel except > "foolevel". > > still single rc.conf, not much bigger in practice. But each line has become more complicated, going from a simple on/off setting to a small language that can even have errors (like "foolevel -barlevel"). This violates the second thing on your list of things we don't want to change. Further, while you can easily tell what runlevels a service is on at, you can't easily tell what services are on at a given runlevel - that begs for a tool to be written. If you instead violate the requirement that we stick with a single rc.conf, the conf files can continue to have the same contents. For instance, create rc.conf.d/. If rc.conf exists, we just ignore the directory. Otherwise, use rc.conf/. Or maybe rc.conf gets is a link to rc.conf/default. The downside is that it adding a service now becomes harder - you have to edit each runlevel script instead of just one. This also begs for a tool to be written. Given the choice between having a file that wants a tool for reading, or one that wants a tool for writing, I'll take the latter. > 2) no change in rc.d/* scripts and rc.conf, but change in scripts. That's also true for my proposal. http://www.mired.org/ Independent Software developer/SCM consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org