From owner-freebsd-rc@FreeBSD.ORG Sun Apr 24 04:43:56 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id C7A3B1065673 for ; Sun, 24 Apr 2011 04:43:56 +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 8761B14F42E; Sun, 24 Apr 2011 04:43:56 +0000 (UTC) Message-ID: <4DB3AA8C.7090003@FreeBSD.org> Date: Sat, 23 Apr 2011 21:43:56 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110319 Thunderbird/3.1.9 MIME-Version: 1.0 To: Rick Macklem References: <1308036720.478939.1303598424273.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <1308036720.478939.1303598424273.JavaMail.root@erie.cs.uoguelph.ca> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: rc@freebsd.org Subject: Re: rc scripts change for review 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, 24 Apr 2011 04:43:56 -0000 On 04/23/2011 15:40, Rick Macklem wrote: >> >>> One thing I am not sure about is the REQUIRE: list in mountd. >>> nfsserver and nfssrv essentially load the respective module. They >>> are only >>> used if sysctl variables need to be set and that's actually done by >>> nfsd. >>> (Should they be listed in mountd or nfsd or ???) >> >> It's not a good idea to add single scripts that only have a tiny >> function, especially if they are only called conditionally (I.e., they >> contain KEYWORD: nostart). It's preferred to handle these things >> things >> in the script that needs them, or if it's necessary in more than one >> script to add a function to the appropriate .subr (rc, or network). >> >> So can you say a little more about what you're trying to accomplish? >> It's not clear to me why instead of doing this: >> >> + if ! sysctl vfs.newnfs>/dev/null 2>&1; then >> + force_depend nfssrv || return 1 >> + fi >> >> you would not just do this: >> >> + if ! sysctl vfs.newnfs>/dev/null 2>&1; then >> + load_kld nfsd >> + fi >> > Well, the intent of the above was to get the module loaded so that > sysctl could manipulate its sysctl variables. I played with it a bit > and it turns out that neither of the above code snippets work in the > sense that they don't affect the outcome. > > What is needed to make the sysctls work is "nfssrv" has to be in the > REQUIRED: list for either mountd or nfsd. Without it, the sysctls fail > with unknown oid. (I'm guessing there is some delay between the load_kld > and when the module gets its sysctl variables registered?) > > Now, I'm not sure whether there is any advantage to specifying "nfssrv" > in nfsd or mountd, although both seem to work when I test them. "nfsserver" > is in mountd, so unless you guys have a better suggestion, that's where > I'll leave it. From what you're describing the reason it works by using the nfsserver and nfssrv scripts is simply an accident of timing. That's not a good thing no matter how you look at it. :) I understand your dilemma in that the nfsserver "solution" was pre-existing, so you were just following the example you had. However I have this odd idea that we ought to fix broken code, not perpetuate it. Even if I weren't interested in this for pedantic value, the fact that it's only working now as an accident of timing is a good reason to fix it. The load_kld module is safe to run unconditionally (it will simply return if the module is loaded). So what you could do (for both cases) is something like this: load_kld nfsd while ! sysctl vfs.newnfs >/dev/null 2>&1; do sleep .5 done If that works, I think we should add that feature to load_kld itself. 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 Sun Apr 24 05:01:35 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 4FBE8106564A for ; Sun, 24 Apr 2011 05:01:35 +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 97DB314D945; Sun, 24 Apr 2011 05:01:33 +0000 (UTC) Message-ID: <4DB3AEAC.9090201@FreeBSD.org> Date: Sat, 23 Apr 2011 22:01:32 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110319 Thunderbird/3.1.9 MIME-Version: 1.0 To: Jilles Tjoelker References: <201012272253.oBRMrH7k025331@freefall.freebsd.org> <1232C1B4-DA64-4332-906E-288B8C1E39FE@gmail.com> <4D1A3DFE.8090009@FreeBSD.org> <4DACC455.4040603@FreeBSD.org> <20110421232840.GA29218@stack.nl> <4DB0D081.6090900@FreeBSD.org> <20110423104230.GA57811@stack.nl> <4DB2F853.3020202@FreeBSD.org> <20110423215853.GA62363@stack.nl> In-Reply-To: <20110423215853.GA62363@stack.nl> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , "freebsd-rc@FreeBSD.org" , "ggg_mail@inbox.ru" Subject: Re: MFCing sh(1) substitution changes 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, 24 Apr 2011 05:01:35 -0000 On 04/23/2011 14:58, Jilles Tjoelker wrote: > On Sat, Apr 23, 2011 at 09:03:31AM -0700, Doug Barton wrote: >> On 04/23/2011 03:42, Jilles Tjoelker wrote: >>> On Thu, Apr 21, 2011 at 05:49:05PM -0700, Doug Barton wrote: >>>> On 04/21/2011 16:28, Jilles Tjoelker wrote: >>>>>> line="/${line%%[\"\;]*}" >>> >>>>> The meaning of this line depends on the version of sh(1). The correct >>>>> interpretation, used by sh in 9-current and most other shells, is to >>>>> strip from the first double-quote or semicolon onwards. However, sh in >>>>> older FreeBSD versions will strip from the first backslash, double-quote >>>>> or semicolon onwards. >>> >>>>> If the 9-current behaviour is desired for all FreeBSD versions, use: >>>>> line=/${line%%[\"\;]*} >>> >>>> I think it's incredibly unlikely that there would actually be a >>>> backslash in the text, and even if there was, it should be ok to strip >>>> from there. >>> >>> Even if there is, it seems bad if this differs between 8.x and 9.x. > >> So MFC your changes. :) > > Hmm, I think that is a good reason not to MFC them, not a reason to MFC > them. If you write something that differs between 8.x and 9.x, although > it is very unlikely to have practical consequences, I can imagine that > there are scripts where it actually matters and that will break with the > 9.x behaviour. If so, I'd prefer that the breakage is noticed on a major > FreeBSD version upgrade and not on a minor version upgrade. Hence the smiley. -- 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 Sun Apr 24 10:34:56 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9211106564A for ; Sun, 24 Apr 2011 10:34:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8AC8FC13 for ; Sun, 24 Apr 2011 10:34:54 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p3OAAQDu011305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Apr 2011 13:10:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p3OAAQEu019117; Sun, 24 Apr 2011 13:10:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p3OAAQwD019116; Sun, 24 Apr 2011 13:10:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 24 Apr 2011 13:10:26 +0300 From: Kostik Belousov To: Doug Barton Message-ID: <20110424101026.GE48734@deviant.kiev.zoral.com.ua> References: <1308036720.478939.1303598424273.JavaMail.root@erie.cs.uoguelph.ca> <4DB3AA8C.7090003@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ddcd+dsiJrvLd0CP" Content-Disposition: inline In-Reply-To: <4DB3AA8C.7090003@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_40, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: rc@freebsd.org, Rick Macklem Subject: Re: rc scripts change for review 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, 24 Apr 2011 10:34:56 -0000 --ddcd+dsiJrvLd0CP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 23, 2011 at 09:43:56PM -0700, Doug Barton wrote: > On 04/23/2011 15:40, Rick Macklem wrote: > >> > >>>One thing I am not sure about is the REQUIRE: list in mountd. > >>>nfsserver and nfssrv essentially load the respective module. They > >>>are only > >>>used if sysctl variables need to be set and that's actually done by > >>>nfsd. > >>>(Should they be listed in mountd or nfsd or ???) > >> > >>It's not a good idea to add single scripts that only have a tiny > >>function, especially if they are only called conditionally (I.e., they > >>contain KEYWORD: nostart). It's preferred to handle these things > >>things > >>in the script that needs them, or if it's necessary in more than one > >>script to add a function to the appropriate .subr (rc, or network). > >> > >>So can you say a little more about what you're trying to accomplish? > >>It's not clear to me why instead of doing this: > >> > >>+ if ! sysctl vfs.newnfs>/dev/null 2>&1; then > >>+ force_depend nfssrv || return 1 > >>+ fi > >> > >>you would not just do this: > >> > >>+ if ! sysctl vfs.newnfs>/dev/null 2>&1; then > >>+ load_kld nfsd > >>+ fi > >> > >Well, the intent of the above was to get the module loaded so that > >sysctl could manipulate its sysctl variables. I played with it a bit > >and it turns out that neither of the above code snippets work in the > >sense that they don't affect the outcome. > > > >What is needed to make the sysctls work is "nfssrv" has to be in the > >REQUIRED: list for either mountd or nfsd. Without it, the sysctls fail > >with unknown oid. (I'm guessing there is some delay between the load_kld > >and when the module gets its sysctl variables registered?) > > > >Now, I'm not sure whether there is any advantage to specifying "nfssrv" > >in nfsd or mountd, although both seem to work when I test them. "nfsserv= er" > >is in mountd, so unless you guys have a better suggestion, that's where > >I'll leave it. >=20 > From what you're describing the reason it works by using the nfsserver=20 > and nfssrv scripts is simply an accident of timing. That's not a good=20 > thing no matter how you look at it. :) I understand your dilemma in=20 > that the nfsserver "solution" was pre-existing, so you were just=20 > following the example you had. However I have this odd idea that we=20 > ought to fix broken code, not perpetuate it. Even if I weren't=20 > interested in this for pedantic value, the fact that it's only working=20 > now as an accident of timing is a good reason to fix it. >=20 > The load_kld module is safe to run unconditionally (it will simply=20 > return if the module is loaded). So what you could do (for both cases)=20 > is something like this: >=20 > load_kld nfsd > while ! sysctl vfs.newnfs >/dev/null 2>&1; do > sleep .5 > done >=20 > If that works, I think we should add that feature to load_kld itself. This is a kludge, hiding some bug. Sysctl oids are registered synchronously, and kldload(2) syscall loads the module in context of the called thread. So if MOD_LOAD even handler registered its oids, then usermode and sysctl(8) should see them without arbitrary wait. --ddcd+dsiJrvLd0CP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk2z9xIACgkQC3+MBN1Mb4iX5ACdHhw3eqWilCTp4EGG3kz4mQZU GZMAoL4eeLXptEvbZ0xzIhThItBwnH1c =6NTb -----END PGP SIGNATURE----- --ddcd+dsiJrvLd0CP-- From owner-freebsd-rc@FreeBSD.ORG Sun Apr 24 12:05:06 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8C69106564A; Sun, 24 Apr 2011 12:05:05 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 85C358FC12; Sun, 24 Apr 2011 12:05:05 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEAJQQtE2DaFvO/2dsb2JhbACET6ILiHCpIo9cgSmDUH0EjjU X-IronPort-AV: E=Sophos;i="4.64,263,1301889600"; d="scan'208";a="118461601" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 24 Apr 2011 08:05:04 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 64513B3FAE; Sun, 24 Apr 2011 08:05:04 -0400 (EDT) Date: Sun, 24 Apr 2011 08:05:04 -0400 (EDT) From: Rick Macklem To: Kostik Belousov Message-ID: <1821952689.487242.1303646704352.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20110424101026.GE48734@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: rc@freebsd.org, Doug Barton Subject: Re: rc scripts change for review 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, 24 Apr 2011 12:05:06 -0000 > On Sat, Apr 23, 2011 at 09:43:56PM -0700, Doug Barton wrote: > > On 04/23/2011 15:40, Rick Macklem wrote: > > >> > > >>>One thing I am not sure about is the REQUIRE: list in mountd. > > >>>nfsserver and nfssrv essentially load the respective module. They > > >>>are only > > >>>used if sysctl variables need to be set and that's actually done > > >>>by > > >>>nfsd. > > >>>(Should they be listed in mountd or nfsd or ???) > > >> > > >>It's not a good idea to add single scripts that only have a tiny > > >>function, especially if they are only called conditionally (I.e., > > >>they > > >>contain KEYWORD: nostart). It's preferred to handle these things > > >>things > > >>in the script that needs them, or if it's necessary in more than > > >>one > > >>script to add a function to the appropriate .subr (rc, or > > >>network). > > >> > > >>So can you say a little more about what you're trying to > > >>accomplish? > > >>It's not clear to me why instead of doing this: > > >> > > >>+ if ! sysctl vfs.newnfs>/dev/null 2>&1; then > > >>+ force_depend nfssrv || return 1 > > >>+ fi > > >> > > >>you would not just do this: > > >> > > >>+ if ! sysctl vfs.newnfs>/dev/null 2>&1; then > > >>+ load_kld nfsd > > >>+ fi > > >> > > >Well, the intent of the above was to get the module loaded so that > > >sysctl could manipulate its sysctl variables. I played with it a > > >bit > > >and it turns out that neither of the above code snippets work in > > >the > > >sense that they don't affect the outcome. > > > > > >What is needed to make the sysctls work is "nfssrv" has to be in > > >the > > >REQUIRED: list for either mountd or nfsd. Without it, the sysctls > > >fail > > >with unknown oid. (I'm guessing there is some delay between the > > >load_kld > > >and when the module gets its sysctl variables registered?) > > > > > >Now, I'm not sure whether there is any advantage to specifying > > >"nfssrv" > > >in nfsd or mountd, although both seem to work when I test them. > > >"nfsserver" > > >is in mountd, so unless you guys have a better suggestion, that's > > >where > > >I'll leave it. > > > > From what you're describing the reason it works by using the > > nfsserver > > and nfssrv scripts is simply an accident of timing. That's not a > > good > > thing no matter how you look at it. :) I understand your dilemma in > > that the nfsserver "solution" was pre-existing, so you were just > > following the example you had. However I have this odd idea that we > > ought to fix broken code, not perpetuate it. Even if I weren't > > interested in this for pedantic value, the fact that it's only > > working > > now as an accident of timing is a good reason to fix it. > > Agreed. I was thinking the same thing. > > The load_kld module is safe to run unconditionally (it will simply > > return if the module is loaded). So what you could do (for both > > cases) > > is something like this: > > > > load_kld nfsd > > while ! sysctl vfs.newnfs >/dev/null 2>&1; do > > sleep .5 > > done > > > > If that works, I think we should add that feature to load_kld > > itself. > > This is a kludge, hiding some bug. Sysctl oids are registered > synchronously, > and kldload(2) syscall loads the module in context of the called > thread. > So if MOD_LOAD even handler registered its oids, then usermode and > sysctl(8) > should see them without arbitrary wait. One possible explanation here (and it may be that I haven't set the modules/sysctl stuff up correctly?) is that the "nfsd" module depends on the module "nfscommon" (which is loaded when nfsd is loaded, because of a MODULE_DEPEND() in "nfsd"). The SYSCTL_NODE() is in "nfscommon". I only have a SYSCTL_DECL() in "nfsd". (ie. maybe kldload doesn't wait for "nfscommon" to be loaded.) I just tried: load_kld nfscommon load_kld nfsd - and this works without needing "nfssrv" I'm not sure if the above implies a bug in either my server code or the module loading/sysctl registering stuff, but I'm confortable with doing the 2 load_kld's. rick From owner-freebsd-rc@FreeBSD.ORG Sun Apr 24 12:24:33 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D804A1065676; Sun, 24 Apr 2011 12:24:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 4CA248FC16; Sun, 24 Apr 2011 12:24:32 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p3OCOQSI019465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Apr 2011 15:24:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p3OCOQK7019935; Sun, 24 Apr 2011 15:24:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p3OCOQjL019934; Sun, 24 Apr 2011 15:24:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 24 Apr 2011 15:24:26 +0300 From: Kostik Belousov To: Rick Macklem Message-ID: <20110424122426.GF48734@deviant.kiev.zoral.com.ua> References: <20110424101026.GE48734@deviant.kiev.zoral.com.ua> <1821952689.487242.1303646704352.JavaMail.root@erie.cs.uoguelph.ca> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pQjS7IR0m4/DQQ0Q" Content-Disposition: inline In-Reply-To: <1821952689.487242.1303646704352.JavaMail.root@erie.cs.uoguelph.ca> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: rc@freebsd.org, Doug Barton Subject: Re: rc scripts change for review 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, 24 Apr 2011 12:24:33 -0000 --pQjS7IR0m4/DQQ0Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 24, 2011 at 08:05:04AM -0400, Rick Macklem wrote: > One possible explanation here (and it may be that I haven't set the > modules/sysctl stuff up correctly?) is that the "nfsd" module depends > on the module "nfscommon" (which is loaded when nfsd is loaded, because > of a MODULE_DEPEND() in "nfsd"). The SYSCTL_NODE() is in "nfscommon". > I only have a SYSCTL_DECL() in "nfsd". (ie. maybe kldload doesn't wait > for "nfscommon" to be loaded.) >=20 > I just tried: > load_kld nfscommon > load_kld nfsd > - and this works without needing "nfssrv" >=20 > I'm not sure if the above implies a bug in either my server code or > the module loading/sysctl registering stuff, but I'm confortable with > doing the 2 load_kld's. Dependencies are loaded synchronously too. --pQjS7IR0m4/DQQ0Q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk20FnkACgkQC3+MBN1Mb4jzpACg2HGiYQDdUBEFqOPmQ4Myd+30 XtsAoIIsX4oBlawh+xpc5ae2wUungCa4 =Dpwp -----END PGP SIGNATURE----- --pQjS7IR0m4/DQQ0Q-- From owner-freebsd-rc@FreeBSD.ORG Sun Apr 24 12:42:55 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98501106566B; Sun, 24 Apr 2011 12:42:55 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 3A4008FC18; Sun, 24 Apr 2011 12:42:54 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEALcZtE2DaFvO/2dsb2JhbACET6ILiHCpPY9agSmDUH0EjjU X-IronPort-AV: E=Sophos;i="4.64,263,1301889600"; d="scan'208";a="119324753" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 24 Apr 2011 08:42:54 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 3E0C5B3F95; Sun, 24 Apr 2011 08:42:54 -0400 (EDT) Date: Sun, 24 Apr 2011 08:42:54 -0400 (EDT) From: Rick Macklem To: Kostik Belousov Message-ID: <1851380373.487655.1303648974162.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20110424122426.GF48734@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: rc@freebsd.org, Doug Barton Subject: Re: rc scripts change for review 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, 24 Apr 2011 12:42:55 -0000 > On Sun, Apr 24, 2011 at 08:05:04AM -0400, Rick Macklem wrote: > > One possible explanation here (and it may be that I haven't set the > > modules/sysctl stuff up correctly?) is that the "nfsd" module > > depends > > on the module "nfscommon" (which is loaded when nfsd is loaded, > > because > > of a MODULE_DEPEND() in "nfsd"). The SYSCTL_NODE() is in > > "nfscommon". > > I only have a SYSCTL_DECL() in "nfsd". (ie. maybe kldload doesn't > > wait > > for "nfscommon" to be loaded.) > > > > I just tried: > > load_kld nfscommon > > load_kld nfsd > > - and this works without needing "nfssrv" > > > > I'm not sure if the above implies a bug in either my server code or > > the module loading/sysctl registering stuff, but I'm confortable > > with > > doing the 2 load_kld's. > > Dependencies are loaded synchronously too. Hmm, in this case I think "nfscommon" is linked into the kernel, since it is used by the client as well and the client is linked in. Does that affect the outcome? rick ps: I'll build a kernel without the client linked in and see if that makes a difference. From owner-freebsd-rc@FreeBSD.ORG Sun Apr 24 12:47:47 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9743E106566B; Sun, 24 Apr 2011 12:47:47 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 26CB98FC0C; Sun, 24 Apr 2011 12:47:46 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0EAB8btE2DaFvO/2dsb2JhbAAvhCCiC7Ioj1qEeX0EjjU X-IronPort-AV: E=Sophos;i="4.64,263,1301889600"; d="diff'?scan'208";a="118463393" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 24 Apr 2011 08:47:46 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 4FCA2B3F30; Sun, 24 Apr 2011 08:47:46 -0400 (EDT) Date: Sun, 24 Apr 2011 08:47:46 -0400 (EDT) From: Rick Macklem To: Doug Barton Message-ID: <532445037.487687.1303649266310.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <4DB3AA8C.7090003@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_487686_156809358.1303649266308" X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: rc@freebsd.org Subject: Re: rc scripts change for review 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, 24 Apr 2011 12:47:47 -0000 ------=_Part_487686_156809358.1303649266308 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit ----- Original Message ----- > On 04/23/2011 15:40, Rick Macklem wrote: > >> > >>> One thing I am not sure about is the REQUIRE: list in mountd. > >>> nfsserver and nfssrv essentially load the respective module. They > >>> are only > >>> used if sysctl variables need to be set and that's actually done > >>> by > >>> nfsd. > >>> (Should they be listed in mountd or nfsd or ???) > >> > >> It's not a good idea to add single scripts that only have a tiny > >> function, especially if they are only called conditionally (I.e., > >> they > >> contain KEYWORD: nostart). It's preferred to handle these things > >> things > >> in the script that needs them, or if it's necessary in more than > >> one > >> script to add a function to the appropriate .subr (rc, or network). > >> > >> So can you say a little more about what you're trying to > >> accomplish? > >> It's not clear to me why instead of doing this: > >> > >> + if ! sysctl vfs.newnfs>/dev/null 2>&1; then > >> + force_depend nfssrv || return 1 > >> + fi > >> > >> you would not just do this: > >> > >> + if ! sysctl vfs.newnfs>/dev/null 2>&1; then > >> + load_kld nfsd > >> + fi > >> > > Well, the intent of the above was to get the module loaded so that > > sysctl could manipulate its sysctl variables. I played with it a bit > > and it turns out that neither of the above code snippets work in the > > sense that they don't affect the outcome. > > > > What is needed to make the sysctls work is "nfssrv" has to be in the > > REQUIRED: list for either mountd or nfsd. Without it, the sysctls > > fail > > with unknown oid. (I'm guessing there is some delay between the > > load_kld > > and when the module gets its sysctl variables registered?) > > > > Now, I'm not sure whether there is any advantage to specifying > > "nfssrv" > > in nfsd or mountd, although both seem to work when I test them. > > "nfsserver" > > is in mountd, so unless you guys have a better suggestion, that's > > where > > I'll leave it. > > From what you're describing the reason it works by using the nfsserver > and nfssrv scripts is simply an accident of timing. That's not a good > thing no matter how you look at it. :) I understand your dilemma in > that the nfsserver "solution" was pre-existing, so you were just > following the example you had. However I have this odd idea that we > ought to fix broken code, not perpetuate it. Even if I weren't > interested in this for pedantic value, the fact that it's only working > now as an accident of timing is a good reason to fix it. > > The load_kld module is safe to run unconditionally (it will simply > return if the module is loaded). So what you could do (for both cases) > is something like this: > > load_kld nfsd > while ! sysctl vfs.newnfs >/dev/null 2>&1; do > sleep .5 > done > > If that works, I think we should add that feature to load_kld itself. I've updated the scripts at http://people.freebsd.org/~rmacklem/rc.conf and attached them, so you might not need to go there. Could you please take another look at them. This time nfsd uses the two load_klds and I tried to use "err", but I'm not sure if I checked for nfsuserd failing correctly. Thanks for your help, rick ------=_Part_487686_156809358.1303649266308 Content-Type: text/x-patch; name=nfsd.diff Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=nfsd.diff LS0tIG5mc2Qub3JpZwkyMDExLTA0LTIwIDE4OjQ5OjA4LjAwMDAwMDAwMCAtMDQwMAorKysgbmZz ZAkyMDExLTA0LTI0IDA3OjMzOjA4LjAwMDAwMDAwMCAtMDQwMApAQCAtMTksMTkgKzE5LDggQEAg c2lnX3N0b3A9IlVTUjEiCiAKIG5mc2RfcHJlY21kKCkKIHsKLQlpZiBjaGVja3llc25vIG5mc3Y0 X3NlcnZlcl9lbmFibGU7IHRoZW4KLQkJIyBJZiBuZnN2NF9zZXJ2ZXJfZW5hYmxlIGlzIHllcywg Zm9yY2UgdXNlCi0JCSMgb2YgdGhlIGV4cGVyaW1lbnRhbCBzZXJ2ZXIKLQkJIwotCQlyY19mbGFn cz0iLWUgJHtuZnNfc2VydmVyX2ZsYWdzfSIKLQotCQlpZiAhIGNoZWNreWVzbm8gbmZzdXNlcmRf ZW5hYmxlICAmJiBcCi0JCSAgICAhIC9ldGMvcmMuZC9uZnN1c2VyZCBmb3JjZXN0YXR1cyAxPi9k ZXYvbnVsbCAyPiYxCi0JCXRoZW4KLQkJCWZvcmNlX2RlcGVuZCBuZnN1c2VyZCB8fCByZXR1cm4g MQotCQlmaQotCWVsc2UKLQkJcmNfZmxhZ3M9IiR7bmZzX3NlcnZlcl9mbGFnc30iCisJaWYgY2hl Y2t5ZXNubyBvbGRuZnNfc2VydmVyX2VuYWJsZTsgdGhlbgorCQlyY19mbGFncz0iLW8gJHtuZnNf c2VydmVyX2ZsYWdzfSIKIAogCQlpZiAhIHN5c2N0bCB2ZnMubmZzcnYgPi9kZXYvbnVsbCAyPiYx OyB0aGVuCiAJCQlmb3JjZV9kZXBlbmQgbmZzc2VydmVyIHx8IHJldHVybiAxCkBAIC00MSw2ICsz MCwzMSBAQCBuZnNkX3ByZWNtZCgpCiAJCQllY2hvICdORlMgb24gcmVzZXJ2ZWQgcG9ydCBvbmx5 PVlFUycKIAkJCXN5c2N0bCB2ZnMubmZzcnYubmZzX3ByaXZwb3J0PTEgPiAvZGV2L251bGwKIAkJ ZmkKKwllbHNlCisJCXJjX2ZsYWdzPSIke25mc19zZXJ2ZXJfZmxhZ3N9IgorCisJCSMgTG9hZCB0 aGUgbW9kdWxlcyBub3csIHNvIHRoYXQgdGhlIHZmcy5uZXduZnMgc3lzY3RsCisJCSMgb2lkcyBh cmUgYXZhaWxhYmxlLgorCQlsb2FkX2tsZCBuZnNjb21tb24KKwkJbG9hZF9rbGQgbmZzZAorCisJ CWlmIGNoZWNreWVzbm8gbmZzX3Jlc2VydmVkX3BvcnRfb25seTsgdGhlbgorCQkJZWNobyAnTkZT IG9uIHJlc2VydmVkIHBvcnQgb25seT1ZRVMnCisJCQlzeXNjdGwgdmZzLm5ld25mcy5uZnNfcHJp dnBvcnQ9MSA+IC9kZXYvbnVsbAorCQlmaQorCisJCWlmIGNoZWNreWVzbm8gbmZzdjRfc2VydmVy X2VuYWJsZTsgdGhlbgorCQkJaWYgISBjaGVja3llc25vIG5mc3VzZXJkX2VuYWJsZSAgJiYgXAor CQkJICAgICEgL2V0Yy9yYy5kL25mc3VzZXJkIGZvcmNlc3RhdHVzIDE+L2Rldi9udWxsIDI+JjEK KwkJCXRoZW4KKwkJCQlpZiAhIGZvcmNlX2RlcGVuZCBuZnN1c2VyZDsgdGhlbgorCQkJCQllcnIg MSAiQ2Fubm90IHJ1biBuZnN1c2VyZCIKKwkJCQlmaQorCQkJZmkKKwkJZWxzZQorCQkJZWNobyAn TkZTdjQgaXMgZGlzYWJsZWQnCisJCQlzeXNjdGwgdmZzLm5ld25mcy5zZXJ2ZXJfbWF4X25mc3Zl cnM9MyA+IC9kZXYvbnVsbAorCQlmaQogCWZpCiAKIAlpZiAhIGNoZWNreWVzbm8gcnBjYmluZF9l bmFibGUgICYmIFwK ------=_Part_487686_156809358.1303649266308 Content-Type: text/x-patch; name=mountd.diff Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=mountd.diff LS0tIG1vdW50ZC5vcmlnCTIwMTEtMDQtMjAgMTg6NDk6MDIuMDAwMDAwMDAwIC0wNDAwCisrKyBt b3VudGQJMjAxMS0wNC0yNCAwNzozMzoxNS4wMDAwMDAwMDAgLTA0MDAKQEAgLTM3LDExICszNywx MCBAQCBtb3VudGRfcHJlY21kKCkKIAkJZmkKIAlmaQogCi0JIyBJZiBuZnN2NF9zZXJ2ZXJfZW5h YmxlIGlzIHllcywgZm9yY2UgdXNlIG9mIHRoZSBleHBlcmltZW50YWwKLQkjIHNlcnZlcgorCSMg SWYgb2xkbmZzX3NlcnZlcl9lbmFibGUgaXMgeWVzLCBmb3JjZSB1c2Ugb2YgdGhlIG9sZCBORlMg c2VydmVyCiAJIwotCWlmIGNoZWNreWVzbm8gbmZzdjRfc2VydmVyX2VuYWJsZTsgdGhlbgotCQly Y19mbGFncz0iLWUgJHtyY19mbGFnc30iCisJaWYgY2hlY2t5ZXNubyBvbGRuZnNfc2VydmVyX2Vu YWJsZTsgdGhlbgorCQlyY19mbGFncz0iLW8gJHtyY19mbGFnc30iCiAJZmkKIAogCWlmIGNoZWNr eWVzbm8gemZzX2VuYWJsZTsgdGhlbgo= ------=_Part_487686_156809358.1303649266308-- From owner-freebsd-rc@FreeBSD.ORG Sun Apr 24 12:59:36 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3673A1065670; Sun, 24 Apr 2011 12:59:36 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id CC96A8FC14; Sun, 24 Apr 2011 12:59:35 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEALkdtE2DaFvO/2dsb2JhbACET6ILiHCpO49agSmDUH0EjjU X-IronPort-AV: E=Sophos;i="4.64,263,1301889600"; d="scan'208";a="118463721" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 24 Apr 2011 08:59:35 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id E0242B3F24; Sun, 24 Apr 2011 08:59:34 -0400 (EDT) Date: Sun, 24 Apr 2011 08:59:34 -0400 (EDT) From: Rick Macklem To: Kostik Belousov Message-ID: <1979800974.487836.1303649974843.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20110424122426.GF48734@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: rc@freebsd.org, Doug Barton Subject: Re: rc scripts change for review 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, 24 Apr 2011 12:59:36 -0000 > On Sun, Apr 24, 2011 at 08:05:04AM -0400, Rick Macklem wrote: > > One possible explanation here (and it may be that I haven't set the > > modules/sysctl stuff up correctly?) is that the "nfsd" module > > depends > > on the module "nfscommon" (which is loaded when nfsd is loaded, > > because > > of a MODULE_DEPEND() in "nfsd"). The SYSCTL_NODE() is in > > "nfscommon". > > I only have a SYSCTL_DECL() in "nfsd". (ie. maybe kldload doesn't > > wait > > for "nfscommon" to be loaded.) > > > > I just tried: > > load_kld nfscommon > > load_kld nfsd > > - and this works without needing "nfssrv" > > > > I'm not sure if the above implies a bug in either my server code or > > the module loading/sysctl registering stuff, but I'm confortable > > with > > doing the 2 load_kld's. > > Dependencies are loaded synchronously too. Oops, I know what my bug was/is now. Since the client was linked into the kernel "vfs.newnfs" was there, so the code snippet that did "load_kld nfsd" when it wasn't there didn't happen. Once I made "load_kld nfsd" unconditional, it works and doesn't need the "load_kld nfscommon" first. I think this is now resolved. Sorry about the noise and thanks for the help, rick From owner-freebsd-rc@FreeBSD.ORG Sun Apr 24 13:06:34 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 021C0106564A; Sun, 24 Apr 2011 13:06:34 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 980A48FC15; Sun, 24 Apr 2011 13:06:33 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0EANYftE2DaFvO/2dsb2JhbAAvhCCiC4hwqTGPV4R5fQSONQ X-IronPort-AV: E=Sophos;i="4.64,263,1301889600"; d="diff'?scan'208";a="118464068" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 24 Apr 2011 09:06:32 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id BF5B0B3F2A; Sun, 24 Apr 2011 09:06:32 -0400 (EDT) Date: Sun, 24 Apr 2011 09:06:32 -0400 (EDT) From: Rick Macklem To: Doug Barton Message-ID: <1806099866.487931.1303650392740.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <4DB3AA8C.7090003@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_487930_2075527041.1303650392737" X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: rc@freebsd.org Subject: Re: rc scripts change for review 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, 24 Apr 2011 13:06:34 -0000 ------=_Part_487930_2075527041.1303650392737 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit ----- Original Message ----- > On 04/23/2011 15:40, Rick Macklem wrote: > >> > >>> One thing I am not sure about is the REQUIRE: list in mountd. > >>> nfsserver and nfssrv essentially load the respective module. They > >>> are only > >>> used if sysctl variables need to be set and that's actually done > >>> by > >>> nfsd. > >>> (Should they be listed in mountd or nfsd or ???) > >> > >> It's not a good idea to add single scripts that only have a tiny > >> function, especially if they are only called conditionally (I.e., > >> they > >> contain KEYWORD: nostart). It's preferred to handle these things > >> things > >> in the script that needs them, or if it's necessary in more than > >> one > >> script to add a function to the appropriate .subr (rc, or network). > >> > >> So can you say a little more about what you're trying to > >> accomplish? > >> It's not clear to me why instead of doing this: > >> > >> + if ! sysctl vfs.newnfs>/dev/null 2>&1; then > >> + force_depend nfssrv || return 1 > >> + fi > >> > >> you would not just do this: > >> > >> + if ! sysctl vfs.newnfs>/dev/null 2>&1; then > >> + load_kld nfsd > >> + fi > >> My mistake was that the kernel I was using already had the client linked in, so: sysctl vfs.newnfs wasn't failing and then load_kld nfsd wasn't happenning. > > The load_kld module is safe to run unconditionally (it will simply > return if the module is loaded). So what you could do (for both cases) > is something like this: > > load_kld nfsd > while ! sysctl vfs.newnfs >/dev/null 2>&1; do > sleep .5 > done > > If that works, I think we should add that feature to load_kld itself. > I now just do the load_kld nfsd unconditionally and it works fine. (Although vfs.newnfs was there, vfs.newnfs.nfs_privport isn't until "nfsd" is loaded. I could make it conditional on that, but I don't see a need, since load_kld works when it is already loaded.) I've updated the scripts at: http://people.freebsd.org/~rmacklem/rc.conf and attached them again, so... could you please take another look at them. Thanks, rick ------=_Part_487930_2075527041.1303650392737 Content-Type: text/x-patch; name=nfsd.diff Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=nfsd.diff LS0tIG5mc2Qub3JpZwkyMDExLTA0LTIwIDE4OjQ5OjA4LjAwMDAwMDAwMCAtMDQwMAorKysgbmZz ZAkyMDExLTA0LTI0IDA3OjUyOjIwLjAwMDAwMDAwMCAtMDQwMApAQCAtMTksMTkgKzE5LDggQEAg c2lnX3N0b3A9IlVTUjEiCiAKIG5mc2RfcHJlY21kKCkKIHsKLQlpZiBjaGVja3llc25vIG5mc3Y0 X3NlcnZlcl9lbmFibGU7IHRoZW4KLQkJIyBJZiBuZnN2NF9zZXJ2ZXJfZW5hYmxlIGlzIHllcywg Zm9yY2UgdXNlCi0JCSMgb2YgdGhlIGV4cGVyaW1lbnRhbCBzZXJ2ZXIKLQkJIwotCQlyY19mbGFn cz0iLWUgJHtuZnNfc2VydmVyX2ZsYWdzfSIKLQotCQlpZiAhIGNoZWNreWVzbm8gbmZzdXNlcmRf ZW5hYmxlICAmJiBcCi0JCSAgICAhIC9ldGMvcmMuZC9uZnN1c2VyZCBmb3JjZXN0YXR1cyAxPi9k ZXYvbnVsbCAyPiYxCi0JCXRoZW4KLQkJCWZvcmNlX2RlcGVuZCBuZnN1c2VyZCB8fCByZXR1cm4g MQotCQlmaQotCWVsc2UKLQkJcmNfZmxhZ3M9IiR7bmZzX3NlcnZlcl9mbGFnc30iCisJaWYgY2hl Y2t5ZXNubyBvbGRuZnNfc2VydmVyX2VuYWJsZTsgdGhlbgorCQlyY19mbGFncz0iLW8gJHtuZnNf c2VydmVyX2ZsYWdzfSIKIAogCQlpZiAhIHN5c2N0bCB2ZnMubmZzcnYgPi9kZXYvbnVsbCAyPiYx OyB0aGVuCiAJCQlmb3JjZV9kZXBlbmQgbmZzc2VydmVyIHx8IHJldHVybiAxCkBAIC00MSw2ICsz MCwzMCBAQCBuZnNkX3ByZWNtZCgpCiAJCQllY2hvICdORlMgb24gcmVzZXJ2ZWQgcG9ydCBvbmx5 PVlFUycKIAkJCXN5c2N0bCB2ZnMubmZzcnYubmZzX3ByaXZwb3J0PTEgPiAvZGV2L251bGwKIAkJ ZmkKKwllbHNlCisJCXJjX2ZsYWdzPSIke25mc19zZXJ2ZXJfZmxhZ3N9IgorCisJCSMgTG9hZCB0 aGUgbW9kdWxlcyBub3csIHNvIHRoYXQgdGhlIHZmcy5uZXduZnMgc3lzY3RsCisJCSMgb2lkcyBh cmUgYXZhaWxhYmxlLgorCQlsb2FkX2tsZCBuZnNkCisKKwkJaWYgY2hlY2t5ZXNubyBuZnNfcmVz ZXJ2ZWRfcG9ydF9vbmx5OyB0aGVuCisJCQllY2hvICdORlMgb24gcmVzZXJ2ZWQgcG9ydCBvbmx5 PVlFUycKKwkJCXN5c2N0bCB2ZnMubmV3bmZzLm5mc19wcml2cG9ydD0xID4gL2Rldi9udWxsCisJ CWZpCisKKwkJaWYgY2hlY2t5ZXNubyBuZnN2NF9zZXJ2ZXJfZW5hYmxlOyB0aGVuCisJCQlpZiAh IGNoZWNreWVzbm8gbmZzdXNlcmRfZW5hYmxlICAmJiBcCisJCQkgICAgISAvZXRjL3JjLmQvbmZz dXNlcmQgZm9yY2VzdGF0dXMgMT4vZGV2L251bGwgMj4mMQorCQkJdGhlbgorCQkJCWlmICEgZm9y Y2VfZGVwZW5kIG5mc3VzZXJkOyB0aGVuCisJCQkJCWVyciAxICJDYW5ub3QgcnVuIG5mc3VzZXJk IgorCQkJCWZpCisJCQlmaQorCQllbHNlCisJCQllY2hvICdORlN2NCBpcyBkaXNhYmxlZCcKKwkJ CXN5c2N0bCB2ZnMubmV3bmZzLnNlcnZlcl9tYXhfbmZzdmVycz0zID4gL2Rldi9udWxsCisJCWZp CiAJZmkKIAogCWlmICEgY2hlY2t5ZXNubyBycGNiaW5kX2VuYWJsZSAgJiYgXAo= ------=_Part_487930_2075527041.1303650392737 Content-Type: text/x-patch; name=mountd.diff Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=mountd.diff LS0tIG1vdW50ZC5vcmlnCTIwMTEtMDQtMjAgMTg6NDk6MDIuMDAwMDAwMDAwIC0wNDAwCisrKyBt b3VudGQJMjAxMS0wNC0yNCAwNzozMzoxNS4wMDAwMDAwMDAgLTA0MDAKQEAgLTM3LDExICszNywx MCBAQCBtb3VudGRfcHJlY21kKCkKIAkJZmkKIAlmaQogCi0JIyBJZiBuZnN2NF9zZXJ2ZXJfZW5h YmxlIGlzIHllcywgZm9yY2UgdXNlIG9mIHRoZSBleHBlcmltZW50YWwKLQkjIHNlcnZlcgorCSMg SWYgb2xkbmZzX3NlcnZlcl9lbmFibGUgaXMgeWVzLCBmb3JjZSB1c2Ugb2YgdGhlIG9sZCBORlMg c2VydmVyCiAJIwotCWlmIGNoZWNreWVzbm8gbmZzdjRfc2VydmVyX2VuYWJsZTsgdGhlbgotCQly Y19mbGFncz0iLWUgJHtyY19mbGFnc30iCisJaWYgY2hlY2t5ZXNubyBvbGRuZnNfc2VydmVyX2Vu YWJsZTsgdGhlbgorCQlyY19mbGFncz0iLW8gJHtyY19mbGFnc30iCiAJZmkKIAogCWlmIGNoZWNr eWVzbm8gemZzX2VuYWJsZTsgdGhlbgo= ------=_Part_487930_2075527041.1303650392737-- From owner-freebsd-rc@FreeBSD.ORG Sun Apr 24 19:53:53 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 107761065673 for ; Sun, 24 Apr 2011 19:53:53 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) by mx1.freebsd.org (Postfix) with ESMTP id C47DF8FC14 for ; Sun, 24 Apr 2011 19:53:52 +0000 (UTC) Received: from elsa.codelab.cz (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 6B6D619E02D; Sun, 24 Apr 2011 21:37:51 +0200 (CEST) Received: from [192.168.1.2] (ip-86-49-61-235.net.upcbroadband.cz [86.49.61.235]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 300F319E02F; Sun, 24 Apr 2011 21:37:49 +0200 (CEST) Message-ID: <4DB47C0C.1040708@quip.cz> Date: Sun, 24 Apr 2011 21:37:48 +0200 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.18) Gecko/20110320 SeaMonkey/2.0.13 MIME-Version: 1.0 To: freebsd-rc@freebsd.org, Daniel Braniss References: <4B621C9D.8050101@quip.cz> In-Reply-To: <4B621C9D.8050101@quip.cz> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: rc script for iSCSI initiator 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, 24 Apr 2011 19:53:53 -0000 Miroslav Lachman wrote: > Hi, > > iSCSI initiator is in the base for a long time, but there is not > rc.d/iscsi script to start iSCSI sessions. I found one old in mailing > list and take it as base for my work. > I attached two versions. > > *rc.d_iscsi.all.txt* manage all defined targets at start / stop command > > *rc.d_iscsi.individual.txt* can selectively start / stop individual > sessions (targets defined in /etc/iscsi.conf and in rc.conf > iscsi_targets="") > > It is not intended to direct commit, it is just work in progress and > needs some discussion and improvements from rc folks. > > Scripts are too verbose for better debugging. > > Both of them can be called as: > > /etc/rc.d/iscsi start|stop > > The "individual" version can be called: > > /etc/rc.d/iscsi start|stop [target_name] > > For example: > > # /etc/rc.d/iscsi start styx_storage_1 > debug.iscsi_initiator: 2 -> 0 > Starting iSCSI session for styx_storage_1 > Waiting for /dev/ufs/styx0p1: . OK > /dev/ufs/styx0p1: FILE SYSTEM CLEAN; SKIPPING CHECKS > /dev/ufs/styx0p1: clean, 856565848 free (896 frags, 107070619 blocks, > 0.0% fragmentation) > /dev/ufs/styx0p1 on /vol1 (ufs, local, soft-updates, fsid 2d3d5e4b8b67f290) > > > # /etc/rc.d/iscsi stop styx_storage_1 > Unmounting iSCSI volumes for styx_storage_1 > /dev/ufs/styx0p1: unmount from /vol1 > Stopping iSCSI session for: styx_storage_1 > .....All iSCSI sessions were stopped [...] > I am open to any comments, sugesstions, warnings etc. It is more than one year without comments, sugesstions etc.. The 9.0 release cycle is comming and we still have no rc script for iSCSI initiator in base. Are there somebody willing to commit the script? I can dedicate some of my free time to rewrite it in some "better" way if somebody will tell me what is wrong in an earlier version and what will be the right name for the script. http://lists.freebsd.org/pipermail/freebsd-rc/2010-January/001841.html Miroslav Lachman From owner-freebsd-rc@FreeBSD.ORG Mon Apr 25 11:07:07 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 3735F1065676 for ; Mon, 25 Apr 2011 11:07:07 +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 241C38FC19 for ; Mon, 25 Apr 2011 11:07:07 +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 p3PB778I084672 for ; Mon, 25 Apr 2011 11:07:07 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3PB76pn084670 for freebsd-rc@FreeBSD.org; Mon, 25 Apr 2011 11:07:06 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 25 Apr 2011 11:07:06 GMT Message-Id: <201104251107.p3PB76pn084670@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, 25 Apr 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/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 92 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Apr 25 20:37:56 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 9D15E1065676 for ; Mon, 25 Apr 2011 20:37:56 +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 1D5C514FDE2; Mon, 25 Apr 2011 20:37:54 +0000 (UTC) Message-ID: <4DB5DBA1.7050905@FreeBSD.org> Date: Mon, 25 Apr 2011 13:37:53 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110319 Thunderbird/3.1.9 MIME-Version: 1.0 To: Rick Macklem References: <1806099866.487931.1303650392740.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <1806099866.487931.1303650392740.JavaMail.root@erie.cs.uoguelph.ca> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: rc@freebsd.org Subject: Re: rc scripts change for review 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, 25 Apr 2011 20:37:56 -0000 On 04/24/2011 06:06, Rick Macklem wrote: > I now just do the > load_kld nfsd > unconditionally and it works fine. (Although vfs.newnfs was there, > vfs.newnfs.nfs_privport isn't until "nfsd" is loaded. I could make > it conditional on that, but I don't see a need, since load_kld works > when it is already loaded.) > > I've updated the scripts at: > http://people.freebsd.org/~rmacklem/rc.conf > and attached them again, so... > > could you please take another look at them. Looks fine, thanks for sticking with this. :) Any chance you could do similar surgery to get rid of nfsserver? 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 Tue Apr 26 00:01:33 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D48B106566B; Tue, 26 Apr 2011 00:01:33 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 2AADE8FC19; Tue, 26 Apr 2011 00:01:32 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap0EABoLtk2DaFvO/2dsb2JhbAAvhCChZIhwrEaRKIEpg1B9BI41 X-IronPort-AV: E=Sophos;i="4.64,267,1301889600"; d="scan'208";a="118604000" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 25 Apr 2011 20:01:32 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 51D36B3F2A; Mon, 25 Apr 2011 20:01:32 -0400 (EDT) Date: Mon, 25 Apr 2011 20:01:32 -0400 (EDT) From: Rick Macklem To: Doug Barton Message-ID: <749026943.551774.1303776092275.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <4DB5DBA1.7050905@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: rc@freebsd.org Subject: Re: rc scripts change for review 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, 26 Apr 2011 00:01:33 -0000 > On 04/24/2011 06:06, Rick Macklem wrote: > > I now just do the > > load_kld nfsd > > unconditionally and it works fine. (Although vfs.newnfs was there, > > vfs.newnfs.nfs_privport isn't until "nfsd" is loaded. I could make > > it conditional on that, but I don't see a need, since load_kld works > > when it is already loaded.) > > > > I've updated the scripts at: > > http://people.freebsd.org/~rmacklem/rc.conf > > and attached them again, so... > > > > could you please take another look at them. > > Looks fine, thanks for sticking with this. :) > > Any chance you could do similar surgery to get rid of nfsserver? > I will, but I'll wait a couple of weeks, just in case I need to revert the above changes (if I need to backout the change of default nfs server). Thanks for your help with this, rick From owner-freebsd-rc@FreeBSD.ORG Tue Apr 26 11:50:10 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 A7DA21065677 for ; Tue, 26 Apr 2011 11: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 7F9EC8FC13 for ; Tue, 26 Apr 2011 11: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 p3QBoAUp067852 for ; Tue, 26 Apr 2011 11: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 p3QBoA0O067851; Tue, 26 Apr 2011 11:50:10 GMT (envelope-from gnats) Date: Tue, 26 Apr 2011 11:50:10 GMT Message-Id: <201104261150.p3QBoA0O067851@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Miroslav Lachman <000.fbsd@quip.cz> Cc: Subject: Re: conf/142434: [patch] Add cpuset(1) support to rc.subr(8) X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Miroslav Lachman <000.fbsd@quip.cz> 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, 26 Apr 2011 11:50:10 -0000 The following reply was made to PR conf/142434; it has been noted by GNATS. From: Miroslav Lachman <000.fbsd@quip.cz> To: bug-followup@FreeBSD.org, 000.fbsd@quip.cz Cc: Subject: Re: conf/142434: [patch] Add cpuset(1) support to rc.subr(8) Date: Tue, 26 Apr 2011 13:24:19 +0200 Can some committer reply to this PR if there are any interest to have this feature in base rc.subr for 9.0 RELEASE? Should I change something in the patch? Otherwise this PR can be closed if there is some reason not to have it. Miroslav Lachman From owner-freebsd-rc@FreeBSD.ORG Fri Apr 29 01:41:44 2011 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAEB8106566B for ; Fri, 29 Apr 2011 01:41:44 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id A15B38FC08 for ; Fri, 29 Apr 2011 01:41:44 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnQGABMXuk2DaFvO/2dsb2JhbACEUJN4jjCoN40CkSaBKYNQfQSOXI4n X-IronPort-AV: E=Sophos;i="4.64,284,1301889600"; d="scan'208";a="119865121" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 28 Apr 2011 21:41:43 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id D0D6EB3E95 for ; Thu, 28 Apr 2011 21:41:43 -0400 (EDT) Date: Thu, 28 Apr 2011 21:41:43 -0400 (EDT) From: Rick Macklem To: rc@freebsd.org Message-ID: <1647789806.747493.1304041303774.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20110428070024.GA2884@jh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: Subject: Patch for review 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, 29 Apr 2011 01:41:44 -0000 Hi, Here is a patch submitted by jh@. It makes sense to me (and seems ok from a quick test), but I thought I'd check, just in case. This is related to the recent change done on head (r211124) which makes the NFS clients "nfs" and "oldnfs". Thanks, rick > %%% > Index: etc/defaults/rc.conf > =================================================================== > --- etc/defaults/rc.conf (revision 221148) > +++ etc/defaults/rc.conf (working copy) > @@ -89,7 +89,7 @@ fsck_y_enable="NO" # Set to YES to do fs > fsck_y_flags="" # Additional flags for fsck -y > background_fsck="YES" # Attempt to run fsck in the background where > possible. > background_fsck_delay="60" # Time to wait (seconds) before starting > the fsck. > -netfs_types="nfs:NFS newnfs:NEWNFS smbfs:SMB portalfs:PORTAL > nwfs:NWFS" # Net filesystems. > +netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB portalfs:PORTAL > nwfs:NWFS" # Net filesystems. > extra_netfs_types="NO" # List of network extra filesystem types for > delayed > # mount at startup (or NO). From owner-freebsd-rc@FreeBSD.ORG Fri Apr 29 15:57:54 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 B4E0A106564A for ; Fri, 29 Apr 2011 15:57:54 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1008FC14 for ; Fri, 29 Apr 2011 15:57:53 +0000 (UTC) Received: by eyg7 with SMTP id 7so1492961eyg.13 for ; Fri, 29 Apr 2011 08:57:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=K7y+amzw7Ze94gqWXHHyi3Mm4Za5aD7KV7rP95gbhKs=; b=bBj+4kEw/+fE2QgCOk80XnfwG+VhUpDOe/h5g4E/ooi3bN86zo61TsQWll5ghkoP6H 0NjUVHsnBcFao7ldr6hH/pCW3KsHW08MfTyq8gqjW2S8HQkh8hPnDQMYcXeCpfIdn89X vejKBNOK0UoFsUGwxCDAkJCX0fM7Ve7++RRQU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ePdNGd5E0DA2FdRKeUGt6tcUOpg33QnslfYT/nbQZubnFqF/HHhUPGIrAEJOnT9lox na1oOvFE12Oynm82HgtAA3M6yFsONEpqzm1I2K+MvPELkjdW2bGAXpVnrNPZofi/Ub3b e+jLtgOpzR1dT0IoW0I6/Be9lGWZcPEQSw4A8= MIME-Version: 1.0 Received: by 10.213.29.73 with SMTP id p9mr254073ebc.149.1304090981978; Fri, 29 Apr 2011 08:29:41 -0700 (PDT) Received: by 10.213.35.70 with HTTP; Fri, 29 Apr 2011 08:29:41 -0700 (PDT) Date: Fri, 29 Apr 2011 11:29:41 -0400 Message-ID: From: Ryan Stone To: freebsd-rc@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 29 Apr 2011 15:57:54 -0000 The only day I ran into an issue where certain rc.d scripts were being skipped during boot. I investigated it and the problem was that when rc went to execute the early rc.d scripts, rcorder placed the missed scripts after the early-late divider. However when rcorder was run the second time the missed scripts were placed before the early-late divider. Because of this, rc skipped over those scripts incorrectly. Ultimately, the problem is that we don't have a total ordering over the rc.d scripts. This means that the sequence produced by rcorder isn't guaranteed to be consistent. In particular, if an rc.d script is not ordered with respect to the early-late divider rcorder is free to place it either before or after the divider. If you're unlucky, rcorder may reorder a script on the second invocation. Below I have a patch that fixes the issue for me. Rather than making the incorrect assumption that the second rcorder invocation will create a sequence that is consistent with the first invocation, and skipping all scripts that the second invocation orders before the early-late divider, I instead have rc track with rc.d scripts have already run, and when running the late rc.d scripts rc skips all scripts that have yet to run. There's one caveat to this patch. It assumes that you don't have two different scripts in /etc/rc.d named foo and foo.sh (or foo.bar, for that matter). I can't figure out a way to resolve this with the limited facilities available to rc before the early scripts have been run, but maybe somebody else has an idea? --- rc (revision 221208) +++ rc (working copy) @@ -86,6 +86,9 @@ for _rc_elem in ${files}; do run_rc_script ${_rc_elem} ${_boot} + _rc_basename=${_rc_elem##*/} + eval _${_rc_basename%%.*}_has_run=1 + unset _rc_basename case "$_rc_elem" in */${early_late_divider}) break ;; @@ -103,13 +106,16 @@ esac files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null` -_skip_early=1 for _rc_elem in ${files}; do - case "$_skip_early" in - 1) case "$_rc_elem" in - */${early_late_divider}) _skip_early=0 ;; - esac - continue + case "$_rc_elem" in + /etc/rc.d/*) + _rc_basename=${_rc_elem##*/} + eval _has_run=\$_${_rc_basename%%.*}_has_run + if [ -n "$_has_run" ]; then + unset _has_run _rc_basename + continue + fi + unset _has_run _rc_basename ;; esac From owner-freebsd-rc@FreeBSD.ORG Fri Apr 29 17:49:30 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 D182C1065672 for ; Fri, 29 Apr 2011 17:49:30 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 12C6E8FC14 for ; Fri, 29 Apr 2011 17:49:29 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id p3TABiSR079353; Fri, 29 Apr 2011 05:11:45 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id p3TABi4J079352; Fri, 29 Apr 2011 05:11:44 -0500 (CDT) (envelope-from brooks) Date: Fri, 29 Apr 2011 05:11:44 -0500 From: Brooks Davis To: Ryan Stone Message-ID: <20110429101144.GF75044@lor.one-eyed-alien.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bqc0IY4JZZt50bUr" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (lor.one-eyed-alien.net [127.0.0.1]); Fri, 29 Apr 2011 05:11:45 -0500 (CDT) Cc: freebsd-rc@freebsd.org Subject: Re: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 29 Apr 2011 17:49:30 -0000 --Bqc0IY4JZZt50bUr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 29, 2011 at 11:29:41AM -0400, Ryan Stone wrote: > The only day I ran into an issue where certain rc.d scripts were being > skipped during boot. I investigated it and the problem was that when > rc went to execute the early rc.d scripts, rcorder placed the missed > scripts after the early-late divider. However when rcorder was run > the second time the missed scripts were placed before the early-late > divider. Because of this, rc skipped over those scripts incorrectly. >=20 > Ultimately, the problem is that we don't have a total ordering over > the rc.d scripts. This means that the sequence produced by rcorder > isn't guaranteed to be consistent. In particular, if an rc.d script > is not ordered with respect to the early-late divider rcorder is free > to place it either before or after the divider. If you're unlucky, > rcorder may reorder a script on the second invocation. >=20 > Below I have a patch that fixes the issue for me. Rather than making > the incorrect assumption that the second rcorder invocation will > create a sequence that is consistent with the first invocation, and > skipping all scripts that the second invocation orders before the > early-late divider, I instead have rc track with rc.d scripts have > already run, and when running the late rc.d scripts rc skips all > scripts that have yet to run. I've wanted to do this for a while. I believe this is the right approach. > There's one caveat to this patch. It assumes that you don't have two > different scripts in /etc/rc.d named foo and foo.sh (or foo.bar, for > that matter). I can't figure out a way to resolve this with the > limited facilities available to rc before the early scripts have been > run, but maybe somebody else has an idea? It's hard to do it in general, but if you want to support common things like scripts containing '.', you can use the ltr function. I used this to collapse '.' '-' '/' and '+' to '_' in network.subr (search for _punct_c). I might just support '.' or maybe '.' and '-'. The general answer to this problem would probably be to add a non-standard associative array type based on ksh or bash. The patch below looks fine to me. If you have access to some slow hardware (soekris or something) it might be worth bench marking this to make sure it doesn't slow things down too much but all in all I think the correctness is likely worth it. -- Brooks > --- rc (revision 221208) > +++ rc (working copy) > @@ -86,6 +86,9 @@ >=20 > for _rc_elem in ${files}; do > run_rc_script ${_rc_elem} ${_boot} > + _rc_basename=3D${_rc_elem##*/} > + eval _${_rc_basename%%.*}_has_run=3D1 > + unset _rc_basename >=20 > case "$_rc_elem" in > */${early_late_divider}) break ;; > @@ -103,13 +106,16 @@ > esac >=20 > files=3D`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null` > -_skip_early=3D1 > for _rc_elem in ${files}; do > - case "$_skip_early" in > - 1) case "$_rc_elem" in > - */${early_late_divider}) _skip_early=3D0 ;; > - esac > - continue > + case "$_rc_elem" in > + /etc/rc.d/*) > + _rc_basename=3D${_rc_elem##*/} > + eval _has_run=3D\$_${_rc_basename%%.*}_has_run > + if [ -n "$_has_run" ]; then > + unset _has_run _rc_basename > + continue > + fi > + unset _has_run _rc_basename > ;; > esac > _______________________________________________ > freebsd-rc@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-rc > To unsubscribe, send any mail to "freebsd-rc-unsubscribe@freebsd.org" >=20 --Bqc0IY4JZZt50bUr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFNuo7gXY6L6fI4GtQRAsiVAKCRdcCv3SYYOHyUDeI6E14Z40WfngCg1lZP eZCIbLXUp1fpTyVkFD+nITU= =cxWy -----END PGP SIGNATURE----- --Bqc0IY4JZZt50bUr-- From owner-freebsd-rc@FreeBSD.ORG Fri Apr 29 18:22:19 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 958A7106566C for ; Fri, 29 Apr 2011 18:22:19 +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 BC39114DCD6; Fri, 29 Apr 2011 18:22:18 +0000 (UTC) Message-ID: <4DBB01D9.2060805@FreeBSD.org> Date: Fri, 29 Apr 2011 11:22:17 -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: Ryan Stone References: 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: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 29 Apr 2011 18:22:19 -0000 [ some snipping of things we all agree on ] On 04/29/2011 08:29, Ryan Stone wrote: > The only day I ran into an issue where certain rc.d scripts were being > skipped during boot. I investigated it and the problem was that when > rc went to execute the early rc.d scripts, rcorder placed the missed > scripts after the early-late divider. However when rcorder was run > the second time the missed scripts were placed before the early-late > divider. Because of this, rc skipped over those scripts incorrectly. Yes, that can happen, sorry that it bit you. > Ultimately, the problem is that we don't have a total ordering over > the rc.d scripts. You're right, but unfortunately it's not possible to do with the mandate of supporting diskless boot, and /usr/local on a different (perhaps remote) partition. > Below I have a patch that fixes the issue for me. Your idea is good, but not how I would do it. Keeping a list of files that have already run and then using case to determine if a file is in the list is both faster, and (IMO) easier to read. You can see an example at the end of /etc/defaults/rc.conf. I originally had it in mind to do this, but the situation you described happened so seldom, and was always a result of some other error in the ordering. (Usually something that wasn't local trying to run too early.) However, since there seems to be agreement that this is a step worth taking now, I'll work on it today and post the patch in a bit. 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 Fri Apr 29 18:33:13 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 27B04106564A for ; Fri, 29 Apr 2011 18:33:13 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id B13158FC15 for ; Fri, 29 Apr 2011 18:33:12 +0000 (UTC) Received: by ewy1 with SMTP id 1so1537652ewy.13 for ; Fri, 29 Apr 2011 11:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8hYCCEUvZJuCUhJnCbyP+dyGz4cDTUvu2EKytO4kHS0=; b=i6/jT31RNxkJq7z2b+ZpP9VyLGqq6qoCWU5vqYeIwqWukT6BqJuObRN9iqRhKU8G4L Cbsmt8ov6fThXHDBwXiQn1Am+TaADI067Iph06mcBfqk5cSqbDDkNDZyBbHB2+5oPMlH AzVhcZKwRcVy6Dyx3K0dVxDavNIBEbkp94lxI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=KsjpeSZU147DleGd+xY5kCJRUqRAYVggVHhdqHlaiGaN/BuKVVL2wkUstNKgSVUKGd tyj93mW+FX0Mu3ZLv648XeMBIUhKKjUqhI1XA3w0ByhFTzBms50U3aluvciepCJvmyl2 HLY7/EHJ1f3eqCIsfxv01pMrKWg2ttsW1V35Q= MIME-Version: 1.0 Received: by 10.213.29.73 with SMTP id p9mr347757ebc.149.1304101991281; Fri, 29 Apr 2011 11:33:11 -0700 (PDT) Received: by 10.213.35.70 with HTTP; Fri, 29 Apr 2011 11:33:11 -0700 (PDT) In-Reply-To: <4DBB01D9.2060805@FreeBSD.org> References: <4DBB01D9.2060805@FreeBSD.org> Date: Fri, 29 Apr 2011 14:33:11 -0400 Message-ID: From: Ryan Stone To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-rc@freebsd.org Subject: Re: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 29 Apr 2011 18:33:13 -0000 On Fri, Apr 29, 2011 at 2:22 PM, Doug Barton wrote: > On 04/29/2011 08:29, Ryan Stone wrote: >> Ultimately, the problem is that we don't have a total ordering over >> the rc.d scripts. > > You're right, but unfortunately it's not possible to do with the mandate of > supporting diskless boot, and /usr/local on a different (perhaps remote) > partition. Right, my phrasing was incorrect. What I really meant to say is that the problem is the current rc implementation implicitly assumes that we have a total ordering when we can't guarantee that. From owner-freebsd-rc@FreeBSD.ORG Fri Apr 29 18:57:41 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 664CC106566B for ; Fri, 29 Apr 2011 18:57:41 +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 527C814EE01; Fri, 29 Apr 2011 18:56:59 +0000 (UTC) Message-ID: <4DBB09FA.1040108@FreeBSD.org> Date: Fri, 29 Apr 2011 11:56:58 -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: Ryan Stone References: <4DBB01D9.2060805@FreeBSD.org> In-Reply-To: <4DBB01D9.2060805@FreeBSD.org> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------060504090903010705010802" Cc: freebsd-rc@freebsd.org Subject: Re: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 29 Apr 2011 18:57:41 -0000 This is a multi-part message in MIME format. --------------060504090903010705010802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The attached patch works, is probably cleaner than the existing code, and since the list of things run early is small is certainly no slower than the existing code. Using a space-separated list also has the advantage of not being limited to the format of filenames that it supports. I'll commit it later today unless I get an objection. -- 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/ --------------060504090903010705010802 Content-Type: text/plain; name="rc-save-early.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rc-save-early.diff" Index: rc =================================================================== --- rc (revision 221216) +++ rc (working copy) @@ -84,8 +84,10 @@ # files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null` +_rc_elem_done=' ' for _rc_elem in ${files}; do run_rc_script ${_rc_elem} ${_boot} + _rc_elem_done="${_rc_elem_done}${_rc_elem} " case "$_rc_elem" in */${early_late_divider}) break ;; @@ -103,14 +105,9 @@ esac files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null` -_skip_early=1 for _rc_elem in ${files}; do - case "$_skip_early" in - 1) case "$_rc_elem" in - */${early_late_divider}) _skip_early=0 ;; - esac - continue - ;; + case "$_rc_elem_done" in + *" $_rc_elem "*) continue ;; esac run_rc_script ${_rc_elem} ${_boot} --------------060504090903010705010802-- From owner-freebsd-rc@FreeBSD.ORG Fri Apr 29 19:48:17 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 C3D9E1065672; Fri, 29 Apr 2011 19:48:17 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 579F08FC0C; Fri, 29 Apr 2011 19:48:16 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.4/8.14.4) with ESMTP id p3TCenkx080624; Fri, 29 Apr 2011 07:40:49 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.4/8.14.4/Submit) id p3TCenCF080623; Fri, 29 Apr 2011 07:40:49 -0500 (CDT) (envelope-from brooks) Date: Fri, 29 Apr 2011 07:40:49 -0500 From: Brooks Davis To: Doug Barton Message-ID: <20110429124049.GB79653@lor.one-eyed-alien.net> References: <4DBB01D9.2060805@FreeBSD.org> <4DBB09FA.1040108@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oLBj+sq0vYjzfsbl" Content-Disposition: inline In-Reply-To: <4DBB09FA.1040108@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (lor.one-eyed-alien.net [127.0.0.1]); Fri, 29 Apr 2011 07:40:50 -0500 (CDT) Cc: freebsd-rc@freebsd.org Subject: Re: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 29 Apr 2011 19:48:17 -0000 --oLBj+sq0vYjzfsbl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 29, 2011 at 11:56:58AM -0700, Doug Barton wrote: > The attached patch works, is probably cleaner than the existing code,=20 > and since the list of things run early is small is certainly no slower=20 > than the existing code. Using a space-separated list also has the=20 > advantage of not being limited to the format of filenames that it support= s. Looks good to me. I'll admit I find ':' separators more unixy, but it truly doesn't matter. -- Brooks > I'll commit it later today unless I get an objection. >=20 > --=20 >=20 > Nothin' ever doesn't change, but nothin' changes much. > -- OK Go >=20 > Breadth of IT experience, and depth of knowledge in the DNS. > Yours for the right price. :) http://SupersetSolutions.com/ >=20 > Index: rc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- rc (revision 221216) > +++ rc (working copy) > @@ -84,8 +84,10 @@ > # > files=3D`rcorder ${skip} /etc/rc.d/* 2>/dev/null` > =20 > +_rc_elem_done=3D' ' > for _rc_elem in ${files}; do > run_rc_script ${_rc_elem} ${_boot} > + _rc_elem_done=3D"${_rc_elem_done}${_rc_elem} " > =20 > case "$_rc_elem" in > */${early_late_divider}) break ;; > @@ -103,14 +105,9 @@ > esac > =20 > files=3D`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null` > -_skip_early=3D1 > for _rc_elem in ${files}; do > - case "$_skip_early" in > - 1) case "$_rc_elem" in > - */${early_late_divider}) _skip_early=3D0 ;; > - esac > - continue > - ;; > + case "$_rc_elem_done" in > + *" $_rc_elem "*) continue ;; > esac > =20 > run_rc_script ${_rc_elem} ${_boot} > _______________________________________________ > freebsd-rc@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-rc > To unsubscribe, send any mail to "freebsd-rc-unsubscribe@freebsd.org" --oLBj+sq0vYjzfsbl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFNurHRXY6L6fI4GtQRAtF9AKDFwgPCj3pqBEaVGrXJPhu94BcsSwCeKNYD IIvAWc7jOshqf5GvpFxFttI= =CYDN -----END PGP SIGNATURE----- --oLBj+sq0vYjzfsbl-- From owner-freebsd-rc@FreeBSD.ORG Fri Apr 29 19:52:34 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 63BAA106566B; Fri, 29 Apr 2011 19:52:34 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id C5E2C8FC18; Fri, 29 Apr 2011 19:52:33 +0000 (UTC) Received: by eyg7 with SMTP id 7so1561532eyg.13 for ; Fri, 29 Apr 2011 12:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=iF1bNhhxm7G6gDy/c39OZxiClA1Eb/6kDo3L427BiU8=; b=rNNkOf5mBCpmoMcHabCwbgyp1ZKv8VXz6n6XpIx+/lDBbhO2iG+36aoFJOJA6o6RNQ +/ot3MUZxEBGUioIy2kSWvLzh8rAwT5TUGaJP+++lHyfwmKT77VqeLkUU/CymJUpj6Nt tRkuREmN1KL6P65pb2TIh4EJjSZhwE2TXlN/8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=UVnD/hRXydGghl247NJfF8C+FEsXdlqbikOwg56Z8TowSPY66mbbBlJyQt070du/cl 4pS0uwm5KQDWKkDHWKeoDXWUxAUZhrwyMvpa+gsezyx8EUH3333pBEQF10VwthkgiH3Y si4IQQLPc8XOIjQq+DDw4WRgaF3kQPc0F4BWY= MIME-Version: 1.0 Received: by 10.213.100.197 with SMTP id z5mr384217ebn.111.1304106752419; Fri, 29 Apr 2011 12:52:32 -0700 (PDT) Received: by 10.213.35.70 with HTTP; Fri, 29 Apr 2011 12:52:32 -0700 (PDT) In-Reply-To: <4DBB09FA.1040108@FreeBSD.org> References: <4DBB01D9.2060805@FreeBSD.org> <4DBB09FA.1040108@FreeBSD.org> Date: Fri, 29 Apr 2011 15:52:32 -0400 Message-ID: From: Ryan Stone To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-rc@freebsd.org Subject: Re: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 29 Apr 2011 19:52:34 -0000 rcorder accepts a -s option to have it skip a file and not print it. Would it make sense to instead use that to filter out the scripts that have already run, or are there other consequences of the -s that we don't want? From owner-freebsd-rc@FreeBSD.ORG Fri Apr 29 19:53:31 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 005B71065674; Fri, 29 Apr 2011 19:53:30 +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 F23A814E63D; Fri, 29 Apr 2011 19:53:29 +0000 (UTC) Message-ID: <4DBB1738.6050702@FreeBSD.org> Date: Fri, 29 Apr 2011 12:53: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: Brooks Davis References: <4DBB01D9.2060805@FreeBSD.org> <4DBB09FA.1040108@FreeBSD.org> <20110429124049.GB79653@lor.one-eyed-alien.net> In-Reply-To: <20110429124049.GB79653@lor.one-eyed-alien.net> 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: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 29 Apr 2011 19:53:31 -0000 On 04/29/2011 05:40, Brooks Davis wrote: > I'll admit I find ':' separators more unixy Me too (e.g., the previously mentioned code in rc.conf) but given that we have to take into account stuff from the ports, and it's also not impossible that someone would put Wacky::Perl::Script in /usr/local/etc/rc.d, I wanted to err on the side of caution. :) 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 Fri Apr 29 19:54:43 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 4E00A106564A for ; Fri, 29 Apr 2011 19:54:43 +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 4A53114DB44; Fri, 29 Apr 2011 19:54:40 +0000 (UTC) Message-ID: <4DBB177F.7080004@FreeBSD.org> Date: Fri, 29 Apr 2011 12:54:39 -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: Ryan Stone References: <4DBB01D9.2060805@FreeBSD.org> <4DBB09FA.1040108@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: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 29 Apr 2011 19:54:43 -0000 On 04/29/2011 12:52, Ryan Stone wrote: > rcorder accepts a -s option to have it skip a file and not print it. > Would it make sense to instead use that to filter out the scripts that > have already run, or are there other consequences of the -s that we > don't want? The -s option to rcorder only applies to KEYWORD in the script, not the names of scripts. More good creative thought though, keep it up. :) -- 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 Fri Apr 29 23:07:56 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 9E78A106564A for ; Fri, 29 Apr 2011 23:07:56 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [IPv6:2001:470:a803::1]) by mx1.freebsd.org (Postfix) with ESMTP id 48F228FC08 for ; Fri, 29 Apr 2011 23:07:56 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 6CB4DA6B745; Sat, 30 Apr 2011 07:07:55 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id dP9ptW8o+487; Sat, 30 Apr 2011 07:07:45 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id C3780A6B693; Sat, 30 Apr 2011 07:07:44 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:subject:x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=iX2fWaFlWqY/XFlZkw61Md+ndDlrVtVo3Qo+cExx9MZiFOeWvb8IUfPgioUhMfZBk tIXF55htmy7rFIRMsoPwA== Message-ID: <4DBB44BD.8050808@delphij.net> Date: Fri, 29 Apr 2011 16:07:41 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110317 Thunderbird/3.1.9 ThunderBrowse/3.3.5 MIME-Version: 1.0 To: freebsd-rc@FreeBSD.ORG X-Enigmail-Version: 1.1.2 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Visualization of rc.d order X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net 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, 29 Apr 2011 23:07:56 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi, I've recently made some changes to NetBSD's rcorder-visualization.sh by Joerg and have drawn a svg for base system rc.d scripts' order as of r221230: https://www.delphij.net/rcorder-stock-221230.svg Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBCAAGBQJNu0S9AAoJEATO+BI/yjfBaNUH/27/9xx9cRSR9V3ydour/8ea 3xz1Bzh/llrROlHgSXUUThujN31BBTtcp7tDBFVQDImT/q8J+9T/VQByjxoGa/cO y051DK9k2oxjE1p1YyyL9kAoGT+MmVrcNmCEonTi9xVFWQ6kf46gnCHBahnTpwue wuCLq0YBy1h7M6YrPHnxbBgl8570XxYqAfMdEGyAryA3R/7nPHUux0r7BOaJ+3UO 9mlMT7NWFBgzCVEXLoUAALThFKvP1XSFKV80f67X+jCDaXJN9qx77T5IBJDgItL3 MdYE35CDzNr9uV5YlV/whLgjApZu5PH42yLLFQWkG+VGMDK94YwPlpjBColJoMg= =/BHL -----END PGP SIGNATURE----- From owner-freebsd-rc@FreeBSD.ORG Sat Apr 30 08:16:27 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 2B1C61065670 for ; Sat, 30 Apr 2011 08:16:27 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3fd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id 8F45C8FC18 for ; Sat, 30 Apr 2011 08:16:26 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.187.76.163]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.4) with ESMTP id p3U8GL92040952 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Sat, 30 Apr 2011 09:16:22 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.3 smtp.infracaninophile.co.uk p3U8GL92040952 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1304151382; bh=hG/05gqRP3q9gIU9nVV7EMT9bSskeIIm/X53ENqlKLQ=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4DBBC54C.4080503@infracaninophile.co.uk>|Date:=20S at,=2030=20Apr=202011=2009:16:12=20+0100|From:=20Matthew=20Seaman= 20|User-Agent:=20Mozilla/5.0=20(M acintosh=3B=20U=3B=20Intel=20Mac=20OS=20X=2010.6=3B=20en-US=3B=20r v:1.9.2.17)=20Gecko/20110414=20Thunderbird/3.1.10|MIME-Version:=20 1.0|To:=20freebsd-rc@freebsd.org|Subject:=20Re:=20rc.d=20scripts=2 0can=20be=20missed=20if=20they=20aren't=20ordered=20with=20respect =0D=0A=20to=20the=20early-late=20divider|References:=20=09<4DBB01D9.2060805@Fr eeBSD.org>=20<4DBB09FA.1040108@FreeBSD.org>=09<20110429124049.GB79 653@lor.one-eyed-alien.net>=20<4DBB1738.6050702@FreeBSD.org>|In-Re ply-To:=20<4DBB1738.6050702@FreeBSD.org>|X-Enigmail-Version:=201.1 .1|OpenPGP:=20id=3D60AE908C|Content-Type:=20multipart/signed=3B=20 micalg=3Dpgp-sha1=3B=0D=0A=20protocol=3D"application/pgp-signature "=3B=0D=0A=20boundary=3D"------------enig47BCA9C7B8B945FE362C9F32" ; b=A7u9xok6d3KiF0cA+R1WZmN3soxvoY2pnfUWCaulx3WBI+Q9898hyBrHKgGrCo+QD ed0v3scP/AndcbkK3emeDtdlv3yugp9OZQllvTJFy/8DN+vDNGT1O59W3c5q84aN+9 QCf9Zi3p7RHuAA18ydXUhCVupH0VFW1dsI12dNws= Message-ID: <4DBBC54C.4080503@infracaninophile.co.uk> Date: Sat, 30 Apr 2011 09:16:12 +0100 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-rc@freebsd.org References: <4DBB01D9.2060805@FreeBSD.org> <4DBB09FA.1040108@FreeBSD.org> <20110429124049.GB79653@lor.one-eyed-alien.net> <4DBB1738.6050702@FreeBSD.org> In-Reply-To: <4DBB1738.6050702@FreeBSD.org> X-Enigmail-Version: 1.1.1 OpenPGP: id=60AE908C Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig47BCA9C7B8B945FE362C9F32" X-Virus-Scanned: clamav-milter 0.97 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_FAIL autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lucid-nonsense.infracaninophile.co.uk Subject: Re: rc.d scripts can be missed if they aren't ordered with respect to the early-late divider 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, 30 Apr 2011 08:16:27 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig47BCA9C7B8B945FE362C9F32 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 29/04/2011 20:53, Doug Barton wrote: > it's also not impossible that someone would put Wacky::Perl::Script in > /usr/local/etc/rc.d, I wanted to err on the side of caution. :) Uhuh. "Wacky::Perl::Script" implies a file name something like /usr/local/lib/perl5/site_perl/5.10.1/Wacky/Perl/Script.pm which is a library module rather than an executable program. It would take quite sinister dexterity to cope with such a file name in a perl program. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate JID: matthew@infracaninophile.co.uk Kent, CT11 9PW --------------enig47BCA9C7B8B945FE362C9F32 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk27xVUACgkQ8Mjk52CukIy2/wCffAfRr1oWLuVOGp/4ZhEn1O5S PzMAoJJy1kgY6s6Cp0Ip7TpAjgOEaUER =k+1+ -----END PGP SIGNATURE----- --------------enig47BCA9C7B8B945FE362C9F32-- From owner-freebsd-rc@FreeBSD.ORG Sat Apr 30 10:46:05 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 2A4CF106564A for ; Sat, 30 Apr 2011 10:46:05 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) by mx1.freebsd.org (Postfix) with ESMTP id B8E4D8FC1A for ; Sat, 30 Apr 2011 10:46:04 +0000 (UTC) Received: from mail3.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.13.6/8.13.6) with ESMTP id p3UAPLAe012499 for ; Sat, 30 Apr 2011 12:25:21 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail3.siemens.de (8.13.6/8.13.6) with ESMTP id p3UAPL5R015509 for ; Sat, 30 Apr 2011 12:25:21 +0200 Received: (from localhost) by curry.mchp.siemens.de (8.14.4/8.14.4) id p3UAPL61005348; Date: Sat, 30 Apr 2011 12:25:21 +0200 From: Andre Albsmeier To: freebsd-rc@freebsd.org Message-ID: <20110430102521.GA11716@curry.mchp.siemens.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Echelon: X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Andre.Albsmeier@siemens.com Subject: New knob for ignoring readonly fss in 340.noid and 310.locate? 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, 30 Apr 2011 10:46:05 -0000 I have noticed that "periodic weekly" started to consume more and more time on some of my machines. The reason is the amount of snapshots that are used at my site, e.g., on one machine I have two file systems: /dev/ccd0 544G 266G 235G 53% /people /dev/ccd1 556G 372G 140G 73% /share which hold these snapshots: /dev/md12 544G 241G 259G 48% /people/.snap/@GMT-2011.04.26-03.15.04 /dev/md13 544G 241G 259G 48% /people/.snap/@GMT-2011.04.27-03.15.04 /dev/md14 544G 236G 264G 47% /people/.snap/@GMT-2011.04.28-03.15.03 /dev/md15 544G 240G 260G 48% /people/.snap/@GMT-2011.04.29-03.15.03 /dev/md16 544G 238G 263G 47% /people/.snap/@GMT-2011.04.30-03.15.04 /dev/md17 544G 241G 259G 48% /people/.snap/@GMT-2011.04.23-03.15.01 /dev/md18 544G 239G 261G 48% /people/.snap/@GMT-2011.04.16-03.15.01 /dev/md22 556G 344G 167G 67% /share/.snap/@GMT-2011.04.26-03.28.32 /dev/md23 556G 344G 167G 67% /share/.snap/@GMT-2011.04.27-03.28.26 /dev/md24 556G 344G 167G 67% /share/.snap/@GMT-2011.04.28-03.28.42 /dev/md25 556G 341G 170G 67% /share/.snap/@GMT-2011.04.29-03.29.12 /dev/md26 556G 343G 168G 67% /share/.snap/@GMT-2011.04.30-03.26.48 /dev/md27 556G 344G 167G 67% /share/.snap/@GMT-2011.04.23-03.27.33 /dev/md28 556G 341G 170G 67% /share/.snap/@GMT-2011.04.16-03.27.39 /dev/md29 556G 337G 175G 66% /share/.snap/@GMT-2011.04.09-03.22.01 For our purpose, the weekly maintainance is not desired on the snapshots. Of course, it might be possible to modify the behaviour of 310.locate 340.noid by tweaking /etc/locate.rc or weekly_noid_dirs which would be rather annoying since this would have to be done on every machine individually due to their different filesystem names (and pretty sure will be forgotten when fss are added or removed). One condition that would match everything (at least in my case) would be to restrict the work of 310.locate and 340.noid on filesystems which are not mounted readonly. So what would people think about a knob that restricts at least these two scripts (maybe there are more candidates) from letting find(1) decend into rdonly filesystems? Of course, this knob would default to "off" and could be set in periodic.conf and/or locate.rc individually... Thanks, -Andre From owner-freebsd-rc@FreeBSD.ORG Sat Apr 30 21:32:02 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 D92A7106566B for ; Sat, 30 Apr 2011 21:32:02 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8CD918FC14 for ; Sat, 30 Apr 2011 21:32:02 +0000 (UTC) Received: by iwn33 with SMTP id 33so5374636iwn.13 for ; Sat, 30 Apr 2011 14:32:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:x-openpgp-key-id:x-openpgp-key-fingerprint :x-openpgp-key-url; bh=3PG5DfVeavLoAEKuuWxq5l5dP+X/f4uDKjqJAYB65iw=; b=rYM82NTD8TEajvN/rQw2zg0Kn2EzVdZwET6HMdC90TNXzW0e6bqusS55qRhjd0KVfN prPPZvnlCsWUyheqIOlbcDhssKtl2YdYwqztSh0IL8aG6DPNT25wfCOdx3OafiPsMxIs kB2rJ+LG4X3cUvkgbaTI5YQka9M5Ny6pzkYps= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:x-openpgp-key-id :x-openpgp-key-fingerprint:x-openpgp-key-url; b=rPfNeAj0iOVTTlyMwlQcOOZuTISSI64A0c15JY5/U8qKP9hze2Fxx96q9ex3mB8tCl JkBlBU/WAfhb6auwR7+jDBwl490N3D0ir3vsCL+AHK58wWu2dI2LPlccJQhvb3ITnn7V oD4HhtbyU5FVi5zbzFMLUVdv4EDFdGiLZPMeg= Received: by 10.231.68.202 with SMTP id w10mr5142522ibi.63.1304199122010; Sat, 30 Apr 2011 14:32:02 -0700 (PDT) Received: from DataIX.net (adsl-99-190-84-116.dsl.klmzmi.sbcglobal.net [99.190.84.116]) by mx.google.com with ESMTPS id a8sm1673134ibg.14.2011.04.30.14.32.00 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 30 Apr 2011 14:32:00 -0700 (PDT) Sender: "J. Hellenthal" Received: from DataIX.net (localhost [127.0.0.1]) by DataIX.net (8.14.4/8.14.4) with ESMTP id p3ULVvoK006659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 30 Apr 2011 17:31:58 -0400 (EDT) (envelope-from jhell@DataIX.net) Received: (from jhell@localhost) by DataIX.net (8.14.4/8.14.4/Submit) id p3ULVvBR006658; Sat, 30 Apr 2011 17:31:57 -0400 (EDT) (envelope-from jhell@DataIX.net) Date: Sat, 30 Apr 2011 17:31:57 -0400 From: Jason Hellenthal To: Andre Albsmeier Message-ID: <20110430213157.GC5660@DataIX.net> References: <20110430102521.GA11716@curry.mchp.siemens.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5p8PegU4iirBW1oA" Content-Disposition: inline In-Reply-To: <20110430102521.GA11716@curry.mchp.siemens.de> X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E X-OpenPGP-Key-URL: http://bit.ly/0x89D8547E Cc: freebsd-rc@freebsd.org Subject: Re: New knob for ignoring readonly fss in 340.noid and 310.locate? 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, 30 Apr 2011 21:32:02 -0000 --5p8PegU4iirBW1oA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Andre, By default snapshots directories are hidden and treated as a virtual directory. By enabling the snapshots directory as not hidden you subject yourself to the following behavior. As for a knob to tune the search for the rc.d scripts you mentioned the knob is already provided via zfs(1) zpool(1) through the properties. zfs set snapdir=3Dhidden | visible tank/dataset zpool set listsnaps=3Don | off tank Please use these at your will to tune the system to ignore the directories in question. PS: Leaving snap directories hidden does not mean that they are not available for regular use. ( cd /path/to/.snap/... ) still works as expected. On Sat, Apr 30, 2011 at 12:25:21PM +0200, Andre Albsmeier wrote: >I have noticed that "periodic weekly" started to consume more >and more time on some of my machines. The reason is the amount >of snapshots that are used at my site, e.g., on one machine I >have two file systems: > >/dev/ccd0 544G 266G 235G 53% /people >/dev/ccd1 556G 372G 140G 73% /share > >which hold these snapshots: > >/dev/md12 544G 241G 259G 48% /people/.snap/@GMT-2011= =2E04.26-03.15.04 >/dev/md13 544G 241G 259G 48% /people/.snap/@GMT-2011= =2E04.27-03.15.04 >/dev/md14 544G 236G 264G 47% /people/.snap/@GMT-2011= =2E04.28-03.15.03 >/dev/md15 544G 240G 260G 48% /people/.snap/@GMT-2011= =2E04.29-03.15.03 >/dev/md16 544G 238G 263G 47% /people/.snap/@GMT-2011= =2E04.30-03.15.04 >/dev/md17 544G 241G 259G 48% /people/.snap/@GMT-2011= =2E04.23-03.15.01 >/dev/md18 544G 239G 261G 48% /people/.snap/@GMT-2011= =2E04.16-03.15.01 >/dev/md22 556G 344G 167G 67% /share/.snap/@GMT-2011.= 04.26-03.28.32 >/dev/md23 556G 344G 167G 67% /share/.snap/@GMT-2011.= 04.27-03.28.26 >/dev/md24 556G 344G 167G 67% /share/.snap/@GMT-2011.= 04.28-03.28.42 >/dev/md25 556G 341G 170G 67% /share/.snap/@GMT-2011.= 04.29-03.29.12 >/dev/md26 556G 343G 168G 67% /share/.snap/@GMT-2011.= 04.30-03.26.48 >/dev/md27 556G 344G 167G 67% /share/.snap/@GMT-2011.= 04.23-03.27.33 >/dev/md28 556G 341G 170G 67% /share/.snap/@GMT-2011.= 04.16-03.27.39 >/dev/md29 556G 337G 175G 66% /share/.snap/@GMT-2011.= 04.09-03.22.01 > >For our purpose, the weekly maintainance is not desired on >the snapshots. Of course, it might be possible to modify the >behaviour of > >310.locate >340.noid > >by tweaking /etc/locate.rc or weekly_noid_dirs which would >be rather annoying since this would have to be done on >every machine individually due to their different filesystem >names (and pretty sure will be forgotten when fss are added >or removed). > >One condition that would match everything (at least in my case) >would be to restrict the work of 310.locate and 340.noid on >filesystems which are not mounted readonly. > >So what would people think about a knob that restricts at least >these two scripts (maybe there are more candidates) from letting >find(1) decend into rdonly filesystems? Of course, this knob would >default to "off" and could be set in periodic.conf and/or locate.rc >individually... > --=20 Regards, (jhell) Jason Hellenthal --5p8PegU4iirBW1oA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) Comment: http://bit.ly/0x89D8547E iQEcBAEBAgAGBQJNvH/MAAoJEJBXh4mJ2FR+IXwH/RfQHVxEuTds6bgzwq/LWuia LOuIxX0BgtSPr1d/swPgYeViOzreZllJc1h3pMdfIWn/v/p/y8ZfSgiR0xgbWyTS oymKOoH+nGqn/OHS1fEeLozKKmdyPXFKjA2ZvrYtZUkAph4stE5+jpcymTUMKRSy eX0bLW4F8SQRuuFqs61UIHcjV5mWr3gz7WUIvViuN/ieH6p47fbljYpyqPDG4kU8 w0c5ym+wzUKKsVr6FtFHTIq2nezF8Ga+a+jKSMDGUmHOY022CFJfbW6pYYgzMnIo Rl0X/AMvoISMiZ/7HAgJI6psxQNWTNjaN6o4tthPLuWWYkqFzj+QsaZFQVbytug= =0EZA -----END PGP SIGNATURE----- --5p8PegU4iirBW1oA--