From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 2 04:16:31 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 343A816A41F for ; Tue, 2 Aug 2005 04:16:31 +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 B20EA43D45 for ; Tue, 2 Aug 2005 04:16:28 +0000 (GMT) (envelope-from diz@linuxpowered.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by terrence.linuxpowered.com (Postfix) with ESMTP id B531B26427B; Mon, 1 Aug 2005 23:15:07 -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 02785-09; Mon, 1 Aug 2005 23:15:04 -0500 (CDT) Received: from secure.linuxpowered.com (www.vpisystems.com [70.85.29.100]) by terrence.linuxpowered.com (Postfix) with ESMTP id D72FD264053; Mon, 1 Aug 2005 23:15:03 -0500 (CDT) Received: from 68.95.232.238 (SquirrelMail authenticated user diz@linuxpowered.com); by secure.linuxpowered.com with HTTP; Mon, 1 Aug 2005 23:15:03 -0500 (CDT) Message-ID: <52134.68.95.232.238.1122956103.squirrel@68.95.232.238> In-Reply-To: <20050802030339.GA3993@odin.ac.hmc.edu> References: <64511.68.95.232.238.1122917387.squirrel@68.95.232.238> <20050801204038.GW62369@funkthat.com> <53362.68.95.232.238.1122950874.squirrel@68.95.232.238> <20050802030339.GA3993@odin.ac.hmc.edu> Date: Mon, 1 Aug 2005 23:15:03 -0500 (CDT) From: diz@linuxpowered.com To: "Brooks Davis" 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, John-Mark Gurney Subject: rcorder cache (was [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 04:16:31 -0000 > On Mon, Aug 01, 2005 at 09:47:54PM -0500, diz@linuxpowered.com wrote: >> > 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} > > I'm pretty sure you don't have access to the contents of /etc/rc.conf in > this context. You would have to use another mechanism to control this > feature. I'd be tempted to use the existance of a cache file (probably > /etc/rcorder.cache since it can't be outside /) and simply require users > to regenerate it externally when they upgrade (I'd probably add code to > mergemaster to handle it like the various database files). Note that we > may well break the ability to do this is easily in 7.0 if we end up > supporting ordering of local scripts. Would it be possible or in anyway not unreasonable to source rc.conf in this file? Honestly I was working under the presumption that anytime rc.subr was sourced that the knobs file was too, but possibly my bad. Not that it matters, I can think of ways to work arround this, but I would want to have a rc.d script later on to control the presence of the rcorder cache file for the next boot, or something. I'd hate to use the existence of files to control the functionality, where rc.conf knobs are ideal. -Jon > > -- Brooks > > -- > Any statement of the form "X is the one, true Y" is FALSE. > PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 >