From owner-freebsd-rc@FreeBSD.ORG Sun Nov 7 01:06:27 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E05B1065673 for ; Sun, 7 Nov 2010 01:06:27 +0000 (UTC) (envelope-from cyrille.lefevre-lists@laposte.net) Received: from out3.laposte.net (out4.laposte.net [193.251.214.121]) by mx1.freebsd.org (Postfix) with ESMTP id C587D8FC0C for ; Sun, 7 Nov 2010 01:06:26 +0000 (UTC) Received: from meplus.info (localhost [127.0.0.1]) by mwinf8307.laposte.net (SMTP Server) with ESMTP id 6CBAD700009A; Sun, 7 Nov 2010 02:06:25 +0100 (CET) Received: from [192.168.1.133] (162.64.99-84.rev.gaoland.net [84.99.64.162]) by mwinf8307.laposte.net (SMTP Server) with ESMTP id 156EC7000096; Sun, 7 Nov 2010 02:06:23 +0100 (CET) X-ME-UUID: 20101107010624878.156EC7000096@mwinf8307.laposte.net Message-ID: <4CD5FC23.4060605@laposte.net> Date: Sun, 07 Nov 2010 02:08:51 +0100 From: Cyrille Lefevre Organization: ACME User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Devin Teske References: <1286925182.32724.18.camel@localhost.localdomain> <1286996709.32724.60.camel@localhost.localdomain> <1287448781.5713.3.camel@localhost.localdomain> <1287510629.25599.2.camel@localhost.localdomain> <1288746388.7362.4.camel@localhost.localdomain> <17B64023-A64A-40DA-9CBC-A601710AB5BB@vicor.com> <1288919368.7362.35.camel@localhost.localdomain> <4CD3731C.6020501@laposte.net> <1288978858.7362.154.camel@localhost.localdomain> <4CD4B040.1000804@laposte.net> <1289013402.7362.282.camel@localhost.localdomain> <4CD56812.8080502@laposte.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-me-spamlevel: not-spam X-me-spamrating: 31.600000 X-me-spamcause: OK, (-210)(0000)gggruggvucftvghtrhhoucdtuddrfedtiedrtdelucetggdotefuucfrrhhofhhilhgvmecuoehnohhnvgeqnecuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculddutddmneesvcftvggtihhpihgvnhhtshculddquddttddmneculddquddttddmnehfrhgvvggsshguvdigucdlqddvtddm Cc: freebsd-rc@freebsd.org Subject: Re: sysrc(8) -- a sysctl(8)-like utility for managing rc.conf(5) X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Nov 2010 01:06:27 -0000 Le 06/11/2010 19:14, Devin Teske a =E9crit : > On Nov 6, 2010, at 7:37 AM, Cyrille Lefevre wrote: >> Le 06/11/2010 04:16, Devin Teske a =E9crit : > So, there should be no concern about expanding escape-sequences unless > all of the following is true: >=20 > a. You're using sh, bash, or something similar (not csh or tcsh) well, pdksh :-) freebsd builtin echo doesn't expand \ sequences, sorry. >> this imply performance >> degradation... alternatively, you may want to use the -E option to ech= o >> if supported (freebsd seems to support it, so, use it). >> same remark about read, always use the -r option... >=20 > I think you meant `-e', I'm not familiar with `-E', is that the opposit= e > of `-e' (as in, "don't expand escape-sequences")? well, -E is suppported by pdksh and bash but not by ksh88 nor ksh93. so, consider it as a bashisime. also, I've the habit to alias echo to echo -E under bash to get the bsd behaviour... so, don't care, but rememer you that echo may have bad effects in portable programs. > Use of `-r' depends. I find that it's not enough to say "always use it"= =2E > 50% of the cases I've come across should not use it while the other hal= f > should. It really depends on whether you want to pick up the contents o= f > the next line should there be a trailing back-slash at the end of the > first line read. usual users don't even known the -r option to read and are wrong about that. it's just a remember you :-) forgot my geek code :-) http://www.ebb.org/ungeek/ -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GAT/CS/E/IT/MU/TW@ d-()>++ s:+>: a+@$ C++(+++)>++++ UABCHILOS*++++(+++)$ P-(+)>-- L->+++$ E++(---)@ W++>- N+(+++)@ o? K w !O M- V- PS(+) PE-(--)> Y+ PGP-> t+ 5? X+ R* tv++ b- DI-->+++ D+ G(-) e-(+++) h----(++)> y+++(?) ------END GEEK CODE BLOCK------ http://www.geekcode.com/geek.html see you... Regards, Cyrille Lefevre --=20 mailto:Cyrille.Lefevre-lists@laposte.net From owner-freebsd-rc@FreeBSD.ORG Mon Nov 8 11:07:04 2010 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CFC11065673 for ; Mon, 8 Nov 2010 11:07:04 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4EB028FC1C for ; Mon, 8 Nov 2010 11:07:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oA8B74w9088191 for ; Mon, 8 Nov 2010 11:07:04 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oA8B73s5088189 for freebsd-rc@FreeBSD.org; Mon, 8 Nov 2010 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 8 Nov 2010 11:07:03 GMT Message-Id: <201011081107.oA8B73s5088189@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 11:07:04 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/151063 rc [rc.subr] Verify network link and packet flow before s o conf/150752 rc [rc.subr] [patch] be not needed to eval $_pidcmd on re o conf/150474 rc [patch] rc.d/accounting: Add ability to set location o o conf/149867 rc [PATCH] rc.d script to manage multiple FIBS (kern opti o conf/149831 rc [PATCH] add support to /etc/rc.d/jail for delegating Z o conf/148961 rc [PATCH] netstart and network_ipv6 contains references o conf/148656 rc rc.firewall(8): {oip} and {iip} variables in rc.firewa o conf/147685 rc [rc.d] [patch] new feature for /etc/rc.d/fsck o conf/147444 rc [rc.d] [patch] /etc/rc.d/zfs stop not called on reboot o conf/146053 rc [patch] [request] shutdown of jails breaks inter-jail o conf/145445 rc [rc.d] error in /etc/rc.d/jail (bad logic) o conf/145440 rc [rc.d] [patch] add multiple fib support (setfib) in /e o conf/145399 rc [patch] rc.d scripts are unable to start/stop programs o conf/145344 rc [patch] Fix kitchen sink approach for rc.d scripts ins o conf/145009 rc [patch] rc.subr(8): rc.conf should allow mac label con o conf/144213 rc [rc.d] [patch] Disappearing zvols on reboot o conf/143637 rc [patch] ntpdate(8) support for ntp-servers supplied by o conf/143085 rc [patch] ftp-proxy(8) rc(8) with multiple instances o conf/143084 rc [jail] [patch]: fix rc.d/jail creating stray softlinks o conf/142973 rc [jail] [patch] Strange counter init value in jail rc o conf/142434 rc [patch] Add cpuset(1) support to rc.subr(8) o conf/142304 rc rc.conf(5): mdconfig and mdconfig2 rc.d scripts lack e o conf/141909 rc rc.subr(8): [patch] add rc.conf.d support to /usr/loca o conf/141907 rc [rc.d] Bug if mtu (maybe others?) is set as first argu o conf/141678 rc [patch] A minor enhancement to how /etc/rc.d/jail dete o conf/141275 rc [request] dhclient(8) rc script should print something o conf/140440 rc [patch] allow local command files in rc.{suspend,resum o conf/140261 rc [patch] Improve flexibility of mdconfig2 startup scrip o conf/138208 rc [rc.d] [patch] Making rc.firewall (workstation) IPv6 a o conf/137629 rc [rc.d] background_dhclient rc.conf option causing doub o conf/137470 rc [PATCH] /etc/rc.d/mdconfig2 : prioritize cli parameter o conf/137271 rc [rc.d] Cannot update /etc/host.conf when root filesyst o conf/136875 rc [request] _flags appending o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b o conf/135338 rc [rc.d] pf startup order seems broken [regression] o conf/134918 rc [patch] rc.subr fails to detect perl daemons o conf/134660 rc [patch] rc-script for initializing ng_netflow+ng_ipfw o conf/134333 rc PPP configuration problem in the rc.d scripts in combi o conf/134006 rc [patch] Unload console screensaver kernel modules if s o conf/133987 rc [rc.d] defaultroute broken with DHCP in some cases o conf/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/132483 rc rc.subr(8) [patch] setfib(1) support for rc.subr o conf/132476 rc [rc.d] [patch] add support setfib(1) in rc.d/routing o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/127917 rc [patch] dumpon rejects on start with physmem>swap even o bin/126562 rc rcorder(8) fails to run unrelated startup scripts when o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped p bin/126324 rc [patch] rc.d/tmp: Prevent mounting /tmp in second tim o conf/124747 rc [patch] savecore can't create dump from encrypted swap o conf/124248 rc [jail] [patch] add support for nice value for rc.d/jai o conf/123734 rc [patch] Chipset VIA CX700 requires extra initializatio o conf/123222 rc [patch] Add rtprio(1)/idprio(1) support to rc.subr(8). o conf/122968 rc [rc.d] /etc/rc.d/addswap: md swapfile multiplication a o conf/122477 rc [patch] /etc/rc.d/mdconfig and mdconfig2 are ignoring o conf/122170 rc [patch] [request] New feature: notify admin via page o o kern/121566 rc [nfs] [request] [patch] ethernet iface should be broug o conf/120431 rc [patch] devfs.rules are not initialized under certain o conf/120406 rc [devd] [patch] Handle newly attached pcm devices (eg. o conf/119874 rc [patch] "/etc/rc.d/pf reload" fails if there are macro o conf/119076 rc [patch] [rc.d] /etc/rc.d/netif tries to remove alias a o bin/118325 rc [patch] [request] new periodic script to test statuses o conf/118255 rc savecore never finding kernel core dumps (rcorder prob o conf/117935 rc [patch] ppp fails to start at boot because of missing o conf/113915 rc [patch] ndis wireless driver fails to associate when i o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/109562 rc [rc.d] [patch] [request] Make rc.d/devfs usable from c o conf/108589 rc rtsol(8) fails due to default ipfw rules o conf/106009 rc [ppp] [patch] [request] Fix pppoed startup script to p o conf/105689 rc [ppp] [request] syslogd starts too late at boot o conf/105568 rc [patch] [request] Add more flexibility to rc.conf, to o conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/89870 rc [patch] [request] make netif verbose rc.conf toggle o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/88913 rc [patch] wrapper support for rc.subr o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/73677 rc [patch] add support for powernow states to power_profi o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/56934 rc [patch] rc.firewall rules for natd expect an interface o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/44170 rc [patch] Add ability to run multiple pppoed(8) on start 89 problems total. From owner-freebsd-rc@FreeBSD.ORG Tue Nov 9 07:23:31 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88B06106566B for ; Tue, 9 Nov 2010 07:23:31 +0000 (UTC) (envelope-from dteske@vicor.com) Received: from postoffice.vicor.com (postoffice.vicor.com [69.26.56.53]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0138FC0A for ; Tue, 9 Nov 2010 07:23:30 +0000 (UTC) Received: from [173.241.24.124] (port=49583 helo=[10.0.0.109]) by postoffice.vicor.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1PFiY9-0007BQ-BD; Mon, 08 Nov 2010 23:23:30 -0800 Mime-Version: 1.0 (Apple Message framework v1081) From: Devin Teske In-Reply-To: <1288919368.7362.35.camel@localhost.localdomain> Date: Mon, 8 Nov 2010 23:23:23 -0800 Message-Id: <11FDD7C3-4451-47BD-AE01-58952ACFF586@vicor.com> References: <1286925182.32724.18.camel@localhost.localdomain> <1286996709.32724.60.camel@localhost.localdomain> <1287448781.5713.3.camel@localhost.localdomain> <1287510629.25599.2.camel@localhost.localdomain> <1288746388.7362.4.camel@localhost.localdomain> <17B64023-A64A-40DA-9CBC-A601710AB5BB@vicor.com> <1288919368.7362.35.camel@localhost.localdomain> To: Devin Teske X-Mailer: Apple Mail (2.1081) X-Scan-Signature: 0a4055a72ae5c7848cb83e0bf4da5446 X-Scan-Host: postoffice.vicor.com Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-rc@freebsd.org Subject: Re: sysrc(8) -- a sysctl(8)-like utility for managing rc.conf(5) X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2010 07:23:31 -0000 On Nov 4, 2010, at 6:09 PM, Devin Teske wrote: > And now... for the piece de resistance! >=20 >> ... >=20 > Woohoo... version 3.0! 3.1 now. > This version completely does-away with sed(1), replacing entire swaths > of code with embedded awk(1) scripts. >=20 > This gives the script a much-needed performance boost (quantifiably > about 623-648% increase in performance given `-Ad' flags on a standard > system). And now, 161% increase beyond _that_ (`-Ad' now completes in 2.3 seconds = on my system). ^_^ >>>>>>> Direct links: >>>>>>> http://druidbsd.sf.net/download/sysrc.gz (download gzipped) >>>>>>> http://druidbsd.sf.net/download/sysrc.txt (view as text) > And here's that good-ol' unified patch to show what's changed... --- sysrc.3_0 2010-11-04 17:48:17.000000000 -0700 +++ sysrc 2010-11-08 22:56:20.000000000 -0800 @@ -2,8 +2,8 @@ # -*- tab-width: 4 -*- ;; Emacs # vi: set tabstop=3D4 :: Vi/ViM # -# Revision: 3.0 -# Last Modified: November 4th, 2010 +# Revision: 3.1 +# Last Modified: November 8th, 2010 ############################################################ COPYRIGHT # # (c)2010. Devin Teske. All Rights Reserved. @@ -30,6 +30,7 @@ # SUCH DAMAGE. # # AUTHOR DATE DESCRIPTION +# dteske 2010.11.08 Further significant performance enhancements. # dteske 2010.11.04 Add taint checking. # dteske 2010.11.04 Comments. # dteske 2010.11.04 Significant performance enhancements. @@ -83,6 +84,13 @@ # # *optional # +# Special Thanks to (in order of appearance): +# Brandon Gooch - name suggestion +# Garrett Cooper - structure/mktemp = suggestions +# Julian Elischer - jail suggestions +# Pawel Jakub Dawidek - security suggestions +# Cyrille Lefevre - awk = suggestions +# ############################################################ = CONFIGURATION =20 # @@ -418,6 +426,68 @@ sysrc_find() # does not appear in the source file, it is appended to the end of the = primary # system configuration file `/etc/rc.conf'. # +# This function is a two-parter. Below is the awk(1) portion of the = function, +# afterward is the sh(1) function which utilizes the below awk script. +# +sysrc_set_awk=3D' +# Variables that should be defined on the invocation line: +# -v varname=3D"varname" +# -v new_value=3D"new_value" +# +BEGIN { + regex =3D "^[[:space:]]*"varname"=3D" + retval =3D found =3D 0 +} +{ + # If already found... just spew + if ( found ) { print; next } + + # Does this line match an assignment to our variable? + if ( ! match($0, regex) ) { print; next } + + # Save important match information + found =3D 1 + matchlen =3D RSTART + RLENGTH - 1 + + # Store the value text for later munging + value =3D substr($0, matchlen + 1, length($0) - matchlen) + + # Store the first character of the value + t1 =3D t2 =3D substr(value, 0, 1) + + # Assignment w/ back-ticks, expression, or misc. + # We ignore these since we did not generate them + # + if ( t1 ~ /[\`$\\]/ ) { retval =3D 1; print; next } + + # Assignment w/ single-quoted value + else if ( t1 =3D=3D "'\''" ) { + sub(/^'\''[^'\'']*/, "", value) + if ( length(value) =3D=3D 0 ) t2 =3D "" + sub(/^'\''/, "", value) + } + + # Assignment w/ double-quoted value + else if ( t1 =3D=3D "\"" ) { + sub(/^"(.*\\\\+")*[^"]*/, "", value) + if ( length(value) =3D=3D 0 ) t2 =3D "" + sub(/^"/, "", value) + } + + # Assignment w/ non-quoted value + else if ( t1 ~ /[^[:space:];#]/ ) { + t1 =3D t2 =3D "\"" + sub(/^[^[:space:]]*/, "", value) + } + + # Null-assignment + else if ( t1 ~ /[[:space:]];#]/ ) { t1 =3D t2 =3D "\"" } + + printf "%s%c%s%c%s\n", substr($0, 0, matchlen), \ + t1, new_value, t2, value +} +END { exit retval } +' sysrc_set() { local varname=3D"$1" new_value=3D"$2" @@ -495,77 +565,12 @@ sysrc_set() | awk '{ gsub(/\\/, "\\\\"); gsub(/"/, "\\\""); print }' = )" =20 # - # Generate an awk(1) script to find/replace the appropriate = line. - # If a line suitable-of-replacement is not found, awk will = return - # error-status, indicating that we should append the new value. - # - - local awkscript apos=3D"'" quot=3D'"' bquot=3D'\"' bbtick=3D'\`' - local regex=3D"^[[:space:]]*$varname=3D" - #NOTE: This should be the same regex as used by = sysrc_find() - - awkscript=3D$( cat << EOF - BEGIN { retval =3D 0; found =3D 0 } - { - # If already found... just spew - if ( found ) { print; next } - - # Does this line match an assignment to our variable? - if ( ! match(\$0, /$regex/) ) { print; next } - - # Save important match information - found =3D 1 - matchlen =3D RSTART + RLENGTH - 1 - - # Store the value text for later munging - value =3D substr(\$0, matchlen + 1, length(\$0) - = matchlen) - - # Store the first character of the value - t1 =3D t2 =3D substr(value, 0, 1) - - # Assignment w/ back-ticks, expression, or misc. - # We ignore these since we did not generate them - # - if ( t1 ~ /[$bbtick\\\$\\\\]/ ) - { retval =3D 1; print; next } - - # Assignment w/ single-quoted value - else if ( t1 =3D=3D "$apos" ) { - sub(/^$apos[^$apos]*/, "", value) - if ( length(value) =3D=3D 0 ) t2 =3D "" - sub(/^$apos/, "", value) - } - - # Assignment w/ double-quoted value - else if ( t1 =3D=3D "$bquot" ) { - sub(/^$quot(.*\\\\+$quot)*[^$quot]*/, "", value) - if ( length(value) =3D=3D 0 ) t2 =3D "" - sub(/^$quot/, "", value) - } - - # Assignment w/ non-quoted value - else if ( t1 ~ /[^[:space:];#]/ ) { - t1 =3D t2 =3D "$bquot" - sub(/^[^[:space:]]*/, "", value) - } - - # Null-assignment - else if ( t1 ~ /[[:space:]];#]/ ) - { t1 =3D t2 =3D "$bquot" } - - printf "%s%c%s%c%s\n", substr(\$0, 0, matchlen), \ - t1, "$awk_new_value", t2, value - } - END { exit retval } -EOF - ) - - # # Operate on the matching file, replacing only the last = occurrence. # local new_contents retval new_contents=3D$( tail -r $file 2> /dev/null ) - new_contents=3D$( echo "$new_contents" | awk "$awkscript" ) + new_contents=3D$( echo "$new_contents" | awk -v = varname=3D"$varname" \ + -v new_value=3D"$new_value" "$sysrc_set_awk" ) retval=3D$? =20 # @@ -600,47 +605,49 @@ EOF # Multi-line comments are joined together. Results are NULL if no = description # could be found. # -sysrc_desc() +# This function is a two-parter. Below is the awk(1) portion of the = function, +# afterward is the sh(1) function which utilizes the below awk script. +# +sysrc_desc_awk=3D' +# Variables that should be defined on the invocation line: +# -v varname=3D"varname" +# +BEGIN { + regex =3D "^[[:space:]]*"varname"=3D" + found =3D 0 + buffer =3D "" +} { - local varname=3D"$1" - local regex=3D"^[[:space:]]*$varname=3D" - local vregex=3D"[[:space:]]*[[:alpha:]_][[:alnum:]_]*" - local awkscript - - awkscript=3D$( cat << EOF - BEGIN { found =3D 0; buffer =3D "" } + if ( ! found ) { - if ( ! found ) - { - if ( ! match(\$0, /$regex/) ) next - - found =3D 1 - sub(/^[^#]*(#[[:space:]]*)?/, "") - buffer =3D \$0 - next - } - - if ( !/^[[:space:]]*#/ || - /^[[:space:]]*$vregex=3D/ || - /^[[:space:]]*#$vregex=3D/ || - /^[[:space:]]*$/ ) exit + if ( ! match($0, regex) ) next =20 - sub(/(.*#)*[[:space:]]*/, "") - buffer =3D buffer" "\$0 + found =3D 1 + sub(/^[^#]*(#[[:space:]]*)?/, "") + buffer =3D $0 + next } - END \ - { - # Clean up the buffer - sub(/^[[:space:]]*/, "", buffer) - sub(/[[:space:]]*$/, "", buffer) =20 - print buffer - exit ! found - } -EOF - ) + if ( !/^[[:space:]]*#/ || + /^[[:space:]]*[[:alpha:]_][[:alnum:]_]*=3D/ || + /^[[:space:]]*#[[:alpha:]_][[:alnum:]_]*=3D/ || + /^[[:space:]]*$/ ) exit + + sub(/(.*#)*[[:space:]]*/, "") + buffer =3D buffer" "$0 +} +END { + # Clean up the buffer + sub(/^[[:space:]]*/, "", buffer) + sub(/[[:space:]]*$/, "", buffer) =20 - awk "$awkscript" < "$RC_DEFAULTS" + print buffer + exit ! found +} +' +sysrc_desc() +{ + awk -v varname=3D"$1" "$sysrc_desc_awk" < "$RC_DEFAULTS" } =20 ############################################################ MAIN = SOURCE @@ -815,7 +822,7 @@ if [ "$SHOW_ALL" ]; then IFS=3D"$IFS|" EXCEPT=3D"IFS|EXCEPT|PATH|RC_DEFAULTS|OPTIND|DESCRIBE|SEP"= = EXCEPT=3D"$EXCEPT|SHOW_ALL|SHOW_EQUALS|SHOW_NAME|SHOW_VALUE" - EXCEPT=3D"$EXCEPT|SYSRC_VERBOSE|RC_CONFS" + EXCEPT=3D"$EXCEPT|SYSRC_VERBOSE|RC_CONFS|sysrc_desc_awk" =20 # # Clean the environment (except for our required = variables) -- Cheers, Devin Teske -> CONTACT INFORMATION <- Business Solutions Consultant II FIS - fisglobal.com 510-735-5650 Mobile 510-621-2038 Office 510-621-2020 Office Fax 909-477-4578 Home/Fax devin.teske@fisglobal.com -> LEGAL DISCLAIMER <- This message contains confidential and proprietary information of the sender, and is intended only for the person(s) to whom it is addressed. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you have received this message in error, please notify the e-mail sender immediately, and delete the original message without making a copy. -> FUN STUFF <- -----BEGIN GEEK CODE BLOCK----- Version 3.1 GAT/CS d(+) s: a- C++(++++) UB++++$ P++(++++) L++(++++) !E--- W++ N? o? = K- w O M+ V- PS+ PE Y+ PGP- t(+) 5? X+(++) R>++ tv(+) b+(++) DI+(++) D(+) G+>++ = e>+ h r>++ y+=20 ------END GEEK CODE BLOCK------ http://www.geekcode.com/ -> END TRANSMISSION <- From owner-freebsd-rc@FreeBSD.ORG Thu Nov 11 18:30:14 2010 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86EDD106564A for ; Thu, 11 Nov 2010 18:30:14 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5B6968FC12 for ; Thu, 11 Nov 2010 18:30:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oABIUErb036693 for ; Thu, 11 Nov 2010 18:30:14 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oABIUDO9036687; Thu, 11 Nov 2010 18:30:13 GMT (envelope-from gnats) Date: Thu, 11 Nov 2010 18:30:13 GMT Message-Id: <201011111830.oABIUDO9036687@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Andriy Gapon Cc: Subject: Re: conf/127917: [patch] dumpon rejects on start with physmem> swap even with minidump=1 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andriy Gapon List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 18:30:14 -0000 The following reply was made to PR conf/127917; it has been noted by GNATS. From: Andriy Gapon To: bug-followup@FreeBSD.org, pluknet@gmail.com Cc: Subject: Re: conf/127917: [patch] dumpon rejects on start with physmem>swap even with minidump=1 Date: Thu, 11 Nov 2010 20:29:02 +0200 I think that this PR can now be closed as minidump 1) is enabled by default 2) can be enabled via a tunable -- Andriy Gapon From owner-freebsd-rc@FreeBSD.ORG Fri Nov 12 04:50:10 2010 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625361065695 for ; Fri, 12 Nov 2010 04:50:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4F2158FC1E for ; Fri, 12 Nov 2010 04:50:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAC4oAoS075480 for ; Fri, 12 Nov 2010 04:50:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAC4oA8O075479; Fri, 12 Nov 2010 04:50:10 GMT (envelope-from gnats) Date: Fri, 12 Nov 2010 04:50:10 GMT Message-Id: <201011120450.oAC4oA8O075479@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Sergey Kandaurov Cc: Subject: Re: conf/127917: [patch] dumpon rejects on start with physmem> swap even with minidump=1 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sergey Kandaurov List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 04:50:10 -0000 The following reply was made to PR conf/127917; it has been noted by GNATS. From: Sergey Kandaurov To: Andriy Gapon Cc: bug-followup@freebsd.org Subject: Re: conf/127917: [patch] dumpon rejects on start with physmem>swap even with minidump=1 Date: Fri, 12 Nov 2010 07:13:18 +0300 > I think that this PR can now be closed as minidump > 1) is enabled by default > 2) can be enabled via a tunable p.1 is true only for v7+ (and this PR is also for v6, as far as minidump is off there by default). However, even in 6.x one can workaround the issue by setting the debug.minidump loader tunable into 1, so p.2 is true for all versions, thus PR could be closed. From owner-freebsd-rc@FreeBSD.ORG Fri Nov 12 07:31:39 2010 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E31AF1065672; Fri, 12 Nov 2010 07:31:39 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B70FD8FC08; Fri, 12 Nov 2010 07:31:39 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAC7VdqM071906; Fri, 12 Nov 2010 07:31:39 GMT (envelope-from pluknet@freefall.freebsd.org) Received: (from pluknet@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAC7VdAc071897; Fri, 12 Nov 2010 07:31:39 GMT (envelope-from pluknet) Date: Fri, 12 Nov 2010 07:31:39 GMT Message-Id: <201011120731.oAC7VdAc071897@freefall.freebsd.org> To: pluknet@gmail.com, pluknet@FreeBSD.org, freebsd-rc@FreeBSD.org From: pluknet@FreeBSD.org Cc: Subject: Re: conf/127917: [patch] dumpon rejects on start with physmem>swap even with minidump=1 X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 07:31:40 -0000 Synopsis: [patch] dumpon rejects on start with physmem>swap even with minidump=1 State-Changed-From-To: open->closed State-Changed-By: pluknet State-Changed-When: Fri Nov 12 07:23:51 UTC 2010 State-Changed-Why: This PR can be worked around by setting debug.minidump="1" in loader, thus it's handled before rc.d. Since fixing this PR would require messing with rcorder with unknown possible side-effects, and FreeBSD 6.x with EoL coming soon is only affected, just close this PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=127917