From owner-freebsd-current@FreeBSD.ORG Sat Jul 19 22:49:03 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 512B2106564A; Sat, 19 Jul 2008 22:49:03 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 02C5A8FC0C; Sat, 19 Jul 2008 22:49:02 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from cicely5.cicely.de ([10.1.1.7]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id m6JMn0Zp079933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 20 Jul 2008 00:49:01 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by cicely5.cicely.de (8.14.2/8.14.2) with ESMTP id m6JMmu9M068226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Jul 2008 00:48:56 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id m6JMmu05052740; Sun, 20 Jul 2008 00:48:56 +0200 (CEST) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id m6JMmuSf052739; Sun, 20 Jul 2008 00:48:56 +0200 (CEST) (envelope-from ticso) Date: Sun, 20 Jul 2008 00:48:55 +0200 From: Bernd Walter To: Doug Barton Message-ID: <20080719224855.GM35340@cicely7.cicely.de> References: <200807172056.08835.naylor.b.david@gmail.com> <487FCA89.2010308@FreeBSD.org> <20080718083725.97823be0tg13fn6s@webmail.leidinger.net> <20080718071806.GV62764@server.vk2pj.dyndns.org> <20080718122928.GD35340@cicely7.cicely.de> <4881795A.4070604@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4881795A.4070604@FreeBSD.org> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED=-1.8, AWL=0.140, BAYES_00=-2.599 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on spamd.cicely.de Cc: freebsd-current@freebsd.org, ticso@cicely.de Subject: Re: rc improvements (wanted?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2008 22:49:03 -0000 On Fri, Jul 18, 2008 at 10:19:22PM -0700, Doug Barton wrote: > Bernd Walter wrote: > >Speaking about small systems, where startup time is more a problem than > >on 08/15 desktop and server systems. > >What I would love to see is that scripts like moused, ypserv, lpt, etc > >are not started if the services are disabled. > > That wold be a neat trick, how do you propose we accomplish it? (no, > I'm not being snide.) Sorry - I have no proposal - just a few ideas, of which I know none is perfect. I think it would be great if rcorder can honour the settings somehow, but I'm aware that rc.conf is a shell script and that some files are not depended on any kind of _enable variable. But if we can teach rcorder at least to read the foo_enable variables and drop the script that provide foo. Nevertheless I don't asume it to be a simple task. I'm not familar enough with all the details on how to implement it nor do I request it. All I wanted to do is spread an idea and hope that someone can do something with it. > There are 144 scripts in /etc/rc.d/ on HEAD right now. Out of those I > count roughly 40 that I actually need, so let's round off to 100 > unnecessary scripts to make the math easy. On my system (a pretty fast > C2D) it takes roughly .3 seconds of wall clock time to run one script > that is not enabled. Now cut that roughly in half since each of those > scripts will not have to suck in /etc/rc.subr and /etc/rc.conf* when > run at boot time, and that's 15 seconds of boot time that I could save > on average, let's say +/- 5 seconds. That's worth giving some thought to. Well - my problem about this is more problematic: [217]arm9# time /etc/rc.d/moused start 0.000u 0.000s 0:01.73 44.5% 1196+13491k 1+0io 2pf+0w Ok - you wrote below that rc.subr and Co are loaded only once, so the time on booting should be better. Also the system is not completely idle right now. But anyway - it's a much longer time for slow embedded systems. rcorder is run only once and fast enough for that: [220]arm9# time rcorder /etc/rc.d/* /usr/local/etc/rc.d/* [...] /etc/rc.d/bluetooth /etc/rc.d/bgfsck 0.000u 0.000s 0:01.04 54.8% 777+17180k 0+0io 0pf+0w > One way you could do this is to have /etc/rc.d/active and > /etc/rc.d/inactive (and probably an /etc/rc.d/system for critical > stuff that most people shouldn't touch). Then you could have a > vipw-like system to allow users to edit rc.conf that would move the > scripts to the right directory. Of course, this would be fraught with > potential for problems. :) That's why I'm not doing it manualy, although there are scripts that I will never need to enable. > Another thing that would work for systems that a more sophisticated > admin/user updates with mergemaster would be to write a pre-compare > script that removes all the scripts you know you don't need from the > temproot/etc/rc.d so that they don't get installed. Of course the > benefit of that would not be nearly as wide spread, but it would also > not result in so much foot-shooting. > > >So far each script is started, sucks in routines plus rc.conf > > We're actually a little smarter than that. :) rc.subr and > rc.conf[.local] are loaded once by rc, then each script that runs > inherits those values. That's bad to hear, since that fruit is already taken then ;-) -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.