From owner-svn-src-head@FreeBSD.ORG Fri Jan 13 03:21:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EE8C1065670; Fri, 13 Jan 2012 03:21:47 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 1CA098FC0A; Fri, 13 Jan 2012 03:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=VcPf7tYrA2tYOgYDkCjNGKkgnQyhgZ2O4Mifid9YUhI=; b=aWPZ228ZiqrxybmeqqM8SOW3zRy9N6t2sHkb8XP1sGs+IvsExjgckL3DBrLVgH2ilaa3FqIyIp5gfQ5IFLr2cD+JKM42pmoNZgRmFEYpHchw0qHDP41mMGjKKZNobWeU1DoIeqoMcYDmeDa3nlcOECNn6+mpLPbJSoKtkzACeEkg3OmWVkmFUtSr5TEACLyD6nW22a8ylv6+yKstKl+TffDu6CYA5VQ4b+v4QNU7nWBSLzhiSf0SV5tGQ3Q9Z8zuGyuM5OrnUurZvXCVx2y5+W/746xYLMXdIi5g4Hp08LBQrEkIAM1cygSjNILHklNeCKVmSsMuwVQYHXiLIeN9uQ==; Received: from phoenix.codelabs.ru (ppp91-77-166-241.pppoe.mtu-net.ru [91.77.166.241]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1RlXi5-000O5W-TP; Fri, 13 Jan 2012 06:21:46 +0300 Date: Fri, 13 Jan 2012 11:21:48 +0400 From: Eygene Ryabinkin To: John Baldwin Message-ID: References: <201201120648.q0C6mBio096662@svn.freebsd.org> <201201120748.28564.jhb@freebsd.org> <201201121438.16674.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: <201201121438.16674.jhb@freebsd.org> Sender: rea@codelabs.ru Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 03:21:47 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thu, Jan 12, 2012 at 02:38:16PM -0500, John Baldwin wrote: > On Thursday, January 12, 2012 9:35:05 am Eygene Ryabinkin wrote: > > True, and it was suggested by Doug Barton. But why bother when > > the 'quiet' keyword is reserved for such cases? >=20 > Hmm, that's not quite how I see this. Either /etc/rc.d/dhclient > should silently exit if dhcpif is not true for the given interface, > or it should always whine IMO. It should tell one why it won't start DHCP on the interface, so it should whine at least for the ordinary usage (service dhclient start ), otherwise it will be hard to understand what's going on. > Given that everywhere else uses dhcpif to decide if dhclient should > be run, it seems that an explicit test of that should be used here > as well, even if it means an extra script. In short, this approach > is not consisent with all other users of the dhclient script, As I see, the only other conditional consumer of the dhclient script is /etc/network.subr, procedure ifconfig_up. And it has the other reason to invoke dhcpif: it determines if dhclient should be run synchronously and invokes it explicitely only in this case; for the asynchronous dhclient it relies on the devd to do the work once the interface will come up. > and this seems a hackish approach whose primary goal is to avoid > having devd use a wrapper script. Perhaps that goal is worth the > tradeoff, but it's not really clean. Well, partly my reasoning for suppressing the error message was the following one: 'quiet' will silence the messages about non-enabled service (via _enabled) that is set via rc.conf and in DHCP case we also have rc.conf knob (per-interface 'dhcp' keyword), so that's not a different case. But seems like the whole problem is that I used the err() function instead of doing 'echo $errmsg; exit 1'. Such code shouldn't be conditionalized for the devd, since it is only syslog message that worried people; devd doesn't care what is written to the standard output or the standard error by the scripts it invokes once it become the daemon, since everything goes to /dev/null after calling daemon(3). So, seems like that the following dhclient_pre_check() will make everyone happy: {{{ dhclient_pre_check() { if [ -z "${rc_force}" ] && ! dhcpif $ifn; then echo "'$ifn' is not a DHCP-enabled interface" exit 1 fi } }}} Hadn't tested it yet, but will do it today. > By your argument, btw since we use quietstart during boot, ifn_start > shouldn't even check dhcpif at all now, but just always run the > dhclient script (and if you did make that change, I would protest that > it was very wrong). Well, ifn_start (ifconfig_up to be precise) calls 'dhclient start' and not the 'quietstart'. Moreover, as I had explained, there is other dance with syncdhcpif there, so it can't just invoke dhclient unconditionally. The related topic: in the process of grepping for dhclient within /etc, I had found that /etc/netstart still wants to invoke it. But it will do a lone '/etc/rc.d/dhclient quietstart' and this will never be useful in the current state of dhclient: it will refuse to process any commands without the interface being specified. And since we have the invocation of /etc/rc.d/netif just two lines above, I think that it will be good to remove call to dhclient from /etc/netstart. At the time of the original addition of call to dhclient to /etc/netstart (r114213), dhclient script had another form, http://svnweb.freebsd.org/base/head/etc/rc.d/dhclient?revision=3D113759&v= iew=3Dmarkup&pathrev=3D114213 and it was really a normal rc.d script that requires only one argument. Now it is more of a helper-type script. =2E Am I missing something important here or the removal can really be done? Thanks. --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --wac7ysb48OaltWcw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk8P24wACgkQFq+eroFS7Ps6BQD/aS/GbOO736pyJAJm65/9JHgr eJfcNb4fH9Pox+UQzqIBAIYx6ryjgBrxGTHt1dy8GQqsGal+lGk3tjEWdqtj55K1 =7gDJ -----END PGP SIGNATURE----- --wac7ysb48OaltWcw--