From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 2 02:49:21 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 224CE16A41F for ; Tue, 2 Aug 2005 02:49:21 +0000 (GMT) (envelope-from diz@linuxpowered.com) Received: from terrence.linuxpowered.com (terrence.linuxpowered.com [70.85.29.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD71043D46 for ; Tue, 2 Aug 2005 02:49:18 +0000 (GMT) (envelope-from diz@linuxpowered.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by terrence.linuxpowered.com (Postfix) with ESMTP id 2F28226427B; Mon, 1 Aug 2005 21:47:58 -0500 (CDT) Received: from terrence.linuxpowered.com ([127.0.0.1]) by localhost (terrence.linuxpowered.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29151-09; Mon, 1 Aug 2005 21:47:54 -0500 (CDT) Received: from secure.linuxpowered.com (www.vpisystems.com [70.85.29.100]) by terrence.linuxpowered.com (Postfix) with ESMTP id 8695A264053; Mon, 1 Aug 2005 21:47:54 -0500 (CDT) Received: from 68.95.232.238 (SquirrelMail authenticated user diz@linuxpowered.com); by secure.linuxpowered.com with HTTP; Mon, 1 Aug 2005 21:47:54 -0500 (CDT) Message-ID: <53362.68.95.232.238.1122950874.squirrel@68.95.232.238> In-Reply-To: <20050801204038.GW62369@funkthat.com> References: <64511.68.95.232.238.1122917387.squirrel@68.95.232.238> <20050801204038.GW62369@funkthat.com> Date: Mon, 1 Aug 2005 21:47:54 -0500 (CDT) From: diz@linuxpowered.com To: "John-Mark Gurney" User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: amavisd-new at phpcult.com Cc: freebsd-hackers@freebsd.org Subject: Re: [patch] rc.d cleanup 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: Tue, 02 Aug 2005 02:49:21 -0000 > diz@linuxpowered.com wrote this message on Mon, Aug 01, 2005 at 12:29 > -0500: >> This has the result of reducing the size of the shell code, and reducing > > Unless you cross a fs frag (usually 1024 bytes), i.e. reduce the scripts > by an average of 512bytes *per* script, you will see no disk space savings > from these changes... considering that on my 5.4-R system over half > (73 of 124) are under a frag in size, it isn't that much... > > One thing that would be really useful for rc.d system is a way to cache > the ordering on boot... On a slow system like a 200mhz arm, the rc > ordering can take a long while.... > > -- > John-Mark Gurney Voice: +1 415 225 5579 > > "All that I will do, has been done, All that I have, has not." > Ok thanks for the dirrection. Ask and thy shall receive. well a quick hack at least to implement cache of rcorder, although from my tests even on old hardware rcorder is quick. I wrote this in (cring) the long-spelled out way. Anyways... don't forget to add the essential rc.conf knobs for the two variables shown bellow. [root@:/etc]# diff -u rc rc.new --- rc Sun Jul 31 17:45:19 2005 +++ rc.new Mon Aug 1 21:42:12 2005 @@ -72,7 +72,17 @@ skip="-s nostart" [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ] && skip="$skip -s nojail" -files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null` +# check for a rc.conf knob to check for existing cache, and skip the rcorder part +if checkyesno ${rc_cache_enable} ; then + if [ -f ${rc_cache_file} ] ; then + files=`cat ${rc_cache_file}` + else + files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null` + echo "${files}" > ${rc_cache_file} + fi +else + files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null` +fi for _rc_elem in ${files}; do run_rc_script ${_rc_elem} ${_boot}