From owner-freebsd-rc@FreeBSD.ORG Mon May 30 11:07:06 2011 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 E46431065677 for ; Mon, 30 May 2011 11:07:06 +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 D31478FC18 for ; Mon, 30 May 2011 11:07:06 +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 p4UB76vH050487 for ; Mon, 30 May 2011 11:07:06 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p4UB76Tp050485 for freebsd-rc@FreeBSD.org; Mon, 30 May 2011 11:07:06 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 30 May 2011 11:07:06 GMT Message-Id: <201105301107.p4UB76Tp050485@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, 30 May 2011 11:07:07 -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/154554 rc [rc.d] [patch] statd and lockd fail to start o conf/153666 rc [rc.d][patch] mount filesystems from fstab over zfs da o conf/153200 rc post-boot /etc/rc.d/network_ipv6 start can miss neighb o conf/153123 rc [rc] [patch] add gsched rc file to automatically inser o conf/152784 rc services provide himself instead providing class of se 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/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 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/109272 rc [request] increase default rc shutdown timeout 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 93 problems total. From owner-freebsd-rc@FreeBSD.ORG Tue May 31 21:14:51 2011 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 38FF6106564A; Tue, 31 May 2011 21:14:51 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 28ECE14DE1C; Tue, 31 May 2011 21:14:49 +0000 (UTC) Message-ID: <4DE55A48.8090508@FreeBSD.org> Date: Tue, 31 May 2011 14:14:48 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-rc@FreeBSD.org, "Bjoern A. Zeeb" , Hiroki Sato X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------050207070004000803050409" Cc: Subject: afexists() 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, 31 May 2011 21:14:51 -0000 This is a multi-part message in MIME format. --------------050207070004000803050409 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I don't have any specific objections to this change, although adding more calls to afexists() highlights an issue I addressed previously in looking at network.subr. On my system (with IPv6) it's called over 25 times at each boot, which given that it's a moderately expensive test indicates an opportunity for optimization. Attached is a patch which caches a positive result for support for a given address family. I don't think caching negative results is a good idea since that could change as the boot progresses. I plan to commit this on Friday if there are no objections. Doug -------- Original Message -------- Subject: svn commit: r222515 - in head/etc: . defaults Date: Tue, 31 May 2011 00:25:52 +0000 (UTC) From: Bjoern A. Zeeb To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Author: bz Date: Tue May 31 00:25:52 2011 New Revision: 222515 URL: http://svn.freebsd.org/changeset/base/222515 Log: No logner set an IPv4 loopback address by default in defaults/rc.conf. If not specified, network.subr will add it automatically if we have INET support (1). In network.subr only call the address family up/down functions if the respective AF is available. Switch to new kern.features variables for inet and inet6 as the inet sysctl tree is also available for IPv6-only kernels leading to unexpected results. Suggested by: hrs (1) Reviewed by: hrs Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 20 days Modified: head/etc/defaults/rc.conf head/etc/network.subr --------------050207070004000803050409 Content-Type: text/plain; name="network-subr.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="network-subr.diff" Index: network.subr =================================================================== --- network.subr (revision 222515) +++ network.subr (working copy) @@ -351,22 +351,35 @@ # 1 otherwise. afexists() { - local _af - _af=$1 - - case ${_af} in + case "$1" in inet) - ${SYSCTL_N} kern.features.inet > /dev/null 2>&1 + [ -n "$afexists_inet" ] && return 0 + if ${SYSCTL_N} kern.features.inet > /dev/null 2>&1; then + afexists_inet=afexists_inet + return 0 + fi ;; inet6) - ${SYSCTL_N} kern.features.inet6 > /dev/null 2>&1 + [ -n "$afexists_inet6" ] && return 0 + if ${SYSCTL_N} kern.features.inet6 > /dev/null 2>&1; then + afexists_inet6=afexists_inet6 + return 0 + fi ;; ipx) - ${SYSCTL_N} net.ipx > /dev/null 2>&1 + [ -n "$afexists_ipx" ] && return 0 + if ${SYSCTL_N} net.ipx > /dev/null 2>&1; then + afexists_ipx=afexists_ipx + return 0 + fi ;; atm) + [ -n "$afexists_atm" ] && return 0 if [ -x /sbin/atmconfig ]; then - /sbin/atmconfig diag list > /dev/null 2>&1 + if /sbin/atmconfig diag list > /dev/null 2>&1; then + afexists_atm=afexists_atm + return 0 + fi else return 1 fi --------------050207070004000803050409-- From owner-freebsd-rc@FreeBSD.ORG Wed Jun 1 00:19:40 2011 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 0AD741065670; Wed, 1 Jun 2011 00:19:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id B809E8FC0A; Wed, 1 Jun 2011 00:19:39 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id B873B25D385D; Wed, 1 Jun 2011 00:19:38 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id CDC4C159FD4D; Wed, 1 Jun 2011 00:19:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id ZMbmE3daj8cG; Wed, 1 Jun 2011 00:19:36 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 39932159FD45; Wed, 1 Jun 2011 00:19:36 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <4DE55A48.8090508@FreeBSD.org> Date: Wed, 1 Jun 2011 00:19:34 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <4DE55A48.8090508@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1084) Cc: freebsd-rc@FreeBSD.org Subject: Re: afexists() 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: Wed, 01 Jun 2011 00:19:40 -0000 On May 31, 2011, at 9:14 PM, Doug Barton wrote: Hey, > I don't have any specific objections to this change, although adding = more calls to afexists() highlights an issue I addressed previously in = looking at network.subr. On my system (with IPv6) it's called over 25 = times at each boot, which given that it's a moderately expensive test = indicates an opportunity for optimization. Yeah, it's still a lot cheaper than going into the various = configurations running ifconfigs etc. Especially it does not yield = errors this way;) > Attached is a patch which caches a positive result for support for a = given address family. I don't think caching negative results is a good = idea since that could change as the boot progresses. Not yet for inet or inet6 (or ipx I think) but atm might be loadable. = Looking ahead that's certainly true though maybe also considering = virtualization maybe. >=20 > I plan to commit this on Friday if there are no objections. I am not sure it helps but I see no regression, so if you want, feel = free to go ahead. Bjoern --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-freebsd-rc@FreeBSD.ORG Wed Jun 1 00:32:55 2011 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 4ED7F106566C; Wed, 1 Jun 2011 00:32:55 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 1F24014DC71; Wed, 1 Jun 2011 00:32:53 +0000 (UTC) Message-ID: <4DE588B4.7090908@FreeBSD.org> Date: Tue, 31 May 2011 17:32:52 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <4DE55A48.8090508@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org Subject: Re: afexists() 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: Wed, 01 Jun 2011 00:32:55 -0000 On 05/31/2011 17:19, Bjoern A. Zeeb wrote: > On May 31, 2011, at 9:14 PM, Doug Barton wrote: > > Hey, > >> I don't have any specific objections to this change, although adding more calls to afexists() highlights an issue I addressed previously in looking at network.subr. On my system (with IPv6) it's called over 25 times at each boot, which given that it's a moderately expensive test indicates an opportunity for optimization. > > Yeah, it's still a lot cheaper than going into the various configurations running ifconfigs etc. Especially it does not yield errors this way;) Oh, I agree completely. I'm not saying, "we shouldn't do this," only that we should do it smarter. >> Attached is a patch which caches a positive result for support for a given address family. I don't think caching negative results is a good idea since that could change as the boot progresses. > > Not yet for inet or inet6 (or ipx I think) but atm might be loadable. Looking ahead that's certainly true though maybe also considering virtualization maybe. I think it's generally safer not to cache the negative answer, and from what you're saying it sounds like it may add some future-proofing as well. And yes, I did also have VMs in mind, since I'm doing a lot of work in that area atm. >> I plan to commit this on Friday if there are no objections. > > I am not sure it helps but I see no regression, so if you want, feel free to go ahead. If you can assume that each call to the sysctl takes 100 ms (which is a WAG for sake of argument), then saving 25 of them will result in us booting 2.5 seconds faster. I'd ultimately like to cut the rc.d-related portion of the boot in half, if not more, so every little bit helps. Thanks for the review, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-rc@FreeBSD.ORG Wed Jun 1 04:08:44 2011 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 C86E7106566B; Wed, 1 Jun 2011 04:08:44 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.vlsi.ee.noda.tus.ac.jp (sekine00.ee.noda.sut.ac.jp [133.31.107.40]) by mx1.freebsd.org (Postfix) with ESMTP id 041F48FC08; Wed, 1 Jun 2011 04:08:43 +0000 (UTC) Received: from alph.allbsd.org (p2237-ipbf904funabasi.chiba.ocn.ne.jp [122.26.37.237]) (user=hrs mech=DIGEST-MD5 bits=128) by mail.vlsi.ee.noda.tus.ac.jp (8.14.4/8.14.4) with ESMTP id p5148UhW023226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Jun 2011 13:08:41 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id p5148S94040746; Wed, 1 Jun 2011 13:08:30 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 01 Jun 2011 13:04:34 +0900 (JST) Message-Id: <20110601.130434.820821962809263631.hrs@allbsd.org> To: dougb@FreeBSD.org From: Hiroki Sato In-Reply-To: <4DE588B4.7090908@FreeBSD.org> References: <4DE55A48.8090508@FreeBSD.org> <4DE588B4.7090908@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jun__1_13_04_34_2011_436)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.vlsi.ee.noda.tus.ac.jp [133.31.107.40]); Wed, 01 Jun 2011 13:08:41 +0900 (JST) X-Spam-Status: No, score=6.4 required=14.0 tests=BAYES_50, CONTENT_TYPE_PRESENT, RCVD_IN_CHINA, RCVD_IN_CHINA_KR, RCVD_IN_PBL, RCVD_IN_RP_RNBL, RCVD_IN_TAIWAN, SPF_SOFTFAIL,X_MAILER_PRESENT autolearn=no version=3.3.1 X-Spam-Level: ****** X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.vlsi.ee.noda.tus.ac.jp Cc: bz@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: Re: afexists() 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: Wed, 01 Jun 2011 04:08:45 -0000 ----Security_Multipart(Wed_Jun__1_13_04_34_2011_436)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Doug Barton wrote in <4DE588B4.7090908@FreeBSD.org>: do> >> Attached is a patch which caches a positive result for support for a do> >> given address family. I don't think caching negative results is a good do> >> idea since that could change as the boot progresses. do> > do> > Not yet for inet or inet6 (or ipx I think) but atm might be loadable. do> > Looking ahead that's certainly true though maybe also considering do> > virtualization maybe. do> do> I think it's generally safer not to cache the negative answer, and do> from what you're saying it sounds like it may add some future-proofing do> as well. And yes, I did also have VMs in mind, since I'm doing a lot do> of work in that area atm. Caching the results looks good to me, but I think it is rather safer to keep the results unchanged while a script is running regardless of the value. This is because the rc.d scripts do not assume afexists() returns different values in a run (at least at this moment) , and writing a script to support such a dynamically-changed condition would be quite difficult. do> >> I plan to commit this on Friday if there are no objections. do> > do> > I am not sure it helps but I see no regression, so if you want, feel do> > free to go ahead. do> do> If you can assume that each call to the sysctl takes 100 ms (which is do> a WAG for sake of argument), then saving 25 of them will result in us do> booting 2.5 seconds faster. I'd ultimately like to cut the do> rc.d-related portion of the boot in half, if not more, so every little do> bit helps. I think it would be great if it is possible to create a wrapper function for testing and caching. I expects testing kern.features.* is likely added again to somewhere in rc.d scripts, and adding a long lines of "[ -n ... ] && return 0; if sysctl...; fi" each time degrades readability. -- Hiroki ----Security_Multipart(Wed_Jun__1_13_04_34_2011_436)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk3lulIACgkQTyzT2CeTzy3ZSACgtZql1JS6zeg1qUJnMANTgr/6 tP4An178sM5zbqjiDFVNnogQDamkHZQ6 =WYlU -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jun__1_13_04_34_2011_436)---- From owner-freebsd-rc@FreeBSD.ORG Thu Jun 2 00:05:52 2011 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 407751065672; Thu, 2 Jun 2011 00:05:52 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 59E20152148; Thu, 2 Jun 2011 00:05:29 +0000 (UTC) Message-ID: <4DE6D3C8.1050503@FreeBSD.org> Date: Wed, 01 Jun 2011 17:05:28 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: Hiroki Sato References: <4DE55A48.8090508@FreeBSD.org> <4DE588B4.7090908@FreeBSD.org> <20110601.130434.820821962809263631.hrs@allbsd.org> In-Reply-To: <20110601.130434.820821962809263631.hrs@allbsd.org> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: bz@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: Re: afexists() 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: Thu, 02 Jun 2011 00:05:52 -0000 On 05/31/2011 21:04, Hiroki Sato wrote: > Doug Barton wrote > in<4DE588B4.7090908@FreeBSD.org>: > > do> >> Attached is a patch which caches a positive result for support for a > do> >> given address family. I don't think caching negative results is a good > do> >> idea since that could change as the boot progresses. > do> > > do> > Not yet for inet or inet6 (or ipx I think) but atm might be loadable. > do> > Looking ahead that's certainly true though maybe also considering > do> > virtualization maybe. > do> > do> I think it's generally safer not to cache the negative answer, and > do> from what you're saying it sounds like it may add some future-proofing > do> as well. And yes, I did also have VMs in mind, since I'm doing a lot > do> of work in that area atm. > > Caching the results looks good to me, but I think it is rather safer > to keep the results unchanged while a script is running regardless of > the value. This is because the rc.d scripts do not assume afexists() > returns different values in a run (at least at this moment) , and > writing a script to support such a dynamically-changed condition > would be quite difficult. I understand what you're saying, but I'm not sure which is the worse problem. However, since the likelihood of the situation happening are very small, I think leaving it as is for now is the safest alternative. We can deal with any problems if/when they arise. > do> >> I plan to commit this on Friday if there are no objections. > do> > > do> > I am not sure it helps but I see no regression, so if you want, feel > do> > free to go ahead. > do> > do> If you can assume that each call to the sysctl takes 100 ms (which is > do> a WAG for sake of argument), then saving 25 of them will result in us > do> booting 2.5 seconds faster. I'd ultimately like to cut the > do> rc.d-related portion of the boot in half, if not more, so every little > do> bit helps. > > I think it would be great if it is possible to create a wrapper > function for testing and caching. I expects testing kern.features.* > is likely added again to somewhere in rc.d scripts, and adding a long > lines of "[ -n ... ]&& return 0; if sysctl...; fi" each time > degrades readability. I think that's definitely an interesting idea, and I'd love to review patches that implement it. :) Unfortunately I don't have time to do so atm, and would prefer to focus on a specific case where a small optimization leads to a big gain. Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-freebsd-rc@FreeBSD.ORG Thu Jun 2 02:19:00 2011 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 DD1261065677; Thu, 2 Jun 2011 02:18:59 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.vlsi.ee.noda.tus.ac.jp (sekine00.ee.noda.sut.ac.jp [133.31.107.40]) by mx1.freebsd.org (Postfix) with ESMTP id 616ED8FC19; Thu, 2 Jun 2011 02:18:59 +0000 (UTC) Received: from alph.allbsd.org (p2237-ipbf904funabasi.chiba.ocn.ne.jp [122.26.37.237]) (user=hrs mech=DIGEST-MD5 bits=128) by mail.vlsi.ee.noda.tus.ac.jp (8.14.4/8.14.4) with ESMTP id p522IlSR032939 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Jun 2011 11:18:58 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id p522Iktq051437; Thu, 2 Jun 2011 11:18:47 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Thu, 02 Jun 2011 11:17:53 +0900 (JST) Message-Id: <20110602.111753.392307987943310561.hrs@allbsd.org> To: dougb@FreeBSD.org From: Hiroki Sato In-Reply-To: <4DE6D3C8.1050503@FreeBSD.org> References: <4DE588B4.7090908@FreeBSD.org> <20110601.130434.820821962809263631.hrs@allbsd.org> <4DE6D3C8.1050503@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3 on Emacs 23.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart0(Thu_Jun__2_11_17_53_2011_436)--" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.vlsi.ee.noda.tus.ac.jp [133.31.107.40]); Thu, 02 Jun 2011 11:18:58 +0900 (JST) X-Spam-Status: No, score=6.4 required=14.0 tests=BAYES_50, CONTENT_TYPE_PRESENT, RCVD_IN_CHINA, RCVD_IN_CHINA_KR, RCVD_IN_PBL, RCVD_IN_RP_RNBL, RCVD_IN_TAIWAN, SPF_SOFTFAIL,X_MAILER_PRESENT autolearn=no version=3.3.1 X-Spam-Level: ****** X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.vlsi.ee.noda.tus.ac.jp Cc: bz@FreeBSD.org, freebsd-rc@FreeBSD.org Subject: Re: afexists() 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: Thu, 02 Jun 2011 02:19:00 -0000 ----Security_Multipart0(Thu_Jun__2_11_17_53_2011_436)-- Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Jun__2_11_17_53_2011_860)--" Content-Transfer-Encoding: 7bit ----Next_Part(Thu_Jun__2_11_17_53_2011_860)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Doug Barton wrote in <4DE6D3C8.1050503@FreeBSD.org>: do> On 05/31/2011 21:04, Hiroki Sato wrote: do> > I think it would be great if it is possible to create a wrapper do> > function for testing and caching. I expects testing kern.features.* do> > is likely added again to somewhere in rc.d scripts, and adding a long do> > lines of "[ -n ... ]&& return 0; if sysctl...; fi" each time do> > degrades readability. do> do> I think that's definitely an interesting idea, and I'd love to review do> patches that implement it. :) Unfortunately I don't have time to do so do> atm, and would prefer to focus on a specific case where a small do> optimization leads to a big gain. A patch is attached. -- Hiroki ----Next_Part(Thu_Jun__2_11_17_53_2011_860)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="rc_kern_features_20110602-1.diff" Index: etc/rc.subr =================================================================== --- etc/rc.subr (revision 222591) +++ etc/rc.subr (working copy) @@ -1734,6 +1734,28 @@ fi +# check_kern_features mib +# Return existence of kern.features.* sysctl MIB as true or +# false. The result will be cached in $_rc_cache_kern_features_ +# namespace. "0" means the kern.features.X exists. + +check_kern_features() +{ + local _v + + [ -n "$1" ] || return 1; + _v=`eval echo "\\$_rc_cache_kern_features_$1"` + [ -n "$_v" ] && return "$_v"; + + if ${SYSCTL_N} kern.features.$1 > /dev/null 2>&1; then + eval _rc_cache_kern_features_$1=0 + return 0 + else + eval _rc_cache_kern_features_$1=1 + return 1 + fi +} + # _echoonce var msg mode # mode=0: Echo $msg if ${$var} is empty. # After doing echo, a string is set to ${$var}. Index: etc/network.subr =================================================================== --- etc/network.subr (revision 222591) +++ etc/network.subr (working copy) @@ -355,12 +355,9 @@ _af=$1 case ${_af} in - inet) - ${SYSCTL_N} kern.features.inet > /dev/null 2>&1 + inet|inet6) + check_kern_features ${_af} ;; - inet6) - ${SYSCTL_N} kern.features.inet6 > /dev/null 2>&1 - ;; ipx) ${SYSCTL_N} net.ipx > /dev/null 2>&1 ;; ----Next_Part(Thu_Jun__2_11_17_53_2011_860)---- ----Security_Multipart0(Thu_Jun__2_11_17_53_2011_436)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk3m8tEACgkQTyzT2CeTzy3P6gCgzq+5/4qy/T/w/9mb4pjWg/nY RZAAoMdDDpUm5XPVq2vbWwPoprcuYtg3 =Q23V -----END PGP SIGNATURE----- ----Security_Multipart0(Thu_Jun__2_11_17_53_2011_436)---- From owner-freebsd-rc@FreeBSD.ORG Sat Jun 4 06:13:27 2011 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 507A31065674; Sat, 4 Jun 2011 06:13:27 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2A2D68FC1A; Sat, 4 Jun 2011 06:13:27 +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 p546DRss029469; Sat, 4 Jun 2011 06:13:27 GMT (envelope-from dougb@freefall.freebsd.org) Received: (from dougb@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p546DRh7029462; Sat, 4 Jun 2011 06:13:27 GMT (envelope-from dougb) Date: Sat, 4 Jun 2011 06:13:27 GMT Message-Id: <201106040613.p546DRh7029462@freefall.freebsd.org> To: dougb@FreeBSD.org, freebsd-rc@FreeBSD.org, dougb@FreeBSD.org From: dougb@FreeBSD.org Cc: Subject: Re: conf/151063: [rc.subr] Verify network link and packet flow before starting network services 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: Sat, 04 Jun 2011 06:13:27 -0000 Synopsis: [rc.subr] Verify network link and packet flow before starting network services Responsible-Changed-From-To: freebsd-rc->dougb Responsible-Changed-By: dougb Responsible-Changed-When: Sat Jun 4 06:13:04 UTC 2011 Responsible-Changed-Why: .... because I said I would ... http://www.freebsd.org/cgi/query-pr.cgi?pr=151063